<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: SKC++: No semaphores!</title>
	<atom:link href="http://software-integrity.com/blog/2010/01/07/skc-no-semaphores/feed/" rel="self" type="application/rss+xml" />
	<link>http://software-integrity.com/blog/2010/01/07/skc-no-semaphores/</link>
	<description>Realtime and Embedded Software</description>
	<lastBuildDate>Fri, 21 Oct 2011 15:19:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Peter Bushell</title>
		<link>http://software-integrity.com/blog/2010/01/07/skc-no-semaphores/comment-page-1/#comment-110</link>
		<dc:creator>Peter Bushell</dc:creator>
		<pubDate>Sat, 06 Feb 2010 09:27:29 +0000</pubDate>
		<guid isPermaLink="false">http://software-integrity.com/blog/?p=464#comment-110</guid>
		<description>&lt;a href=&quot;#comment-107&quot; rel=&quot;nofollow&quot;&gt;@David Stonier-Gibson &lt;/a&gt;
David, thank you for contributing to the debate. I sense a touch of the Devil&#039;s Advocate, which is healthy.

The three basic principles which guided me in the design of SKC++ were that it should be:

-  Easy to learn
-  Easy to use
-  Difficult to misuse

My own experience and that of other engineers that I have asked about it is that we like to reserve our time and creativity for the challenge facing us. We don&#039;t want to waste too much time learning how a tool works, or agonising about its options; that should not be part of the challenge. I regard SKC++ primarily as a tool for Application Engineers.

Richness does have its place and there is an argument that you appeal to a greater market if you provide all the traditional, &quot;expected&quot; features as well as any new ones. However, my mission these days is not to sell millions of copies of SKC++ (though more than one or two would be nice), but to distil decades of experience into what I do and deliver only the best bits, thereby making my small contribution to improving embedded software quality. (For the historical enlightenment of those starting out in the profession, I might occasionally blog about the less good bits, but that&#039;s another subject.)

Of course the problem with Occam&#039;s Razor is that you can slice off too much. But to counter that by adding redundant features &quot;just in case&quot; is cowardice. There&#039;s a thin line somewhere in between and that&#039;s why I threw the Semaphore argument open.

Here are some other arguments for the lean approach:

-  Quicker to market (though I still haven&#039;t got there)
-  Less to go wrong
-  Easier to add features, on demand, than to take them away after publication

Who knows, I might make more money adding redundant features for traditionalists (or others stuck in their ways by choice or by circumstance) than I make from the basic product!</description>
		<content:encoded><![CDATA[<p><a href="#comment-107" rel="nofollow">@David Stonier-Gibson </a><br />
David, thank you for contributing to the debate. I sense a touch of the Devil&#8217;s Advocate, which is healthy.</p>
<p>The three basic principles which guided me in the design of SKC++ were that it should be:</p>
<p>-  Easy to learn<br />
-  Easy to use<br />
-  Difficult to misuse</p>
<p>My own experience and that of other engineers that I have asked about it is that we like to reserve our time and creativity for the challenge facing us. We don&#8217;t want to waste too much time learning how a tool works, or agonising about its options; that should not be part of the challenge. I regard SKC++ primarily as a tool for Application Engineers.</p>
<p>Richness does have its place and there is an argument that you appeal to a greater market if you provide all the traditional, &#8220;expected&#8221; features as well as any new ones. However, my mission these days is not to sell millions of copies of SKC++ (though more than one or two would be nice), but to distil decades of experience into what I do and deliver only the best bits, thereby making my small contribution to improving embedded software quality. (For the historical enlightenment of those starting out in the profession, I might occasionally blog about the less good bits, but that&#8217;s another subject.)</p>
<p>Of course the problem with Occam&#8217;s Razor is that you can slice off too much. But to counter that by adding redundant features &#8220;just in case&#8221; is cowardice. There&#8217;s a thin line somewhere in between and that&#8217;s why I threw the Semaphore argument open.</p>
<p>Here are some other arguments for the lean approach:</p>
<p>-  Quicker to market (though I still haven&#8217;t got there)<br />
-  Less to go wrong<br />
-  Easier to add features, on demand, than to take them away after publication</p>
<p>Who knows, I might make more money adding redundant features for traditionalists (or others stuck in their ways by choice or by circumstance) than I make from the basic product!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Stonier-Gibson</title>
		<link>http://software-integrity.com/blog/2010/01/07/skc-no-semaphores/comment-page-1/#comment-107</link>
		<dc:creator>David Stonier-Gibson</dc:creator>
		<pubDate>Fri, 05 Feb 2010 21:34:51 +0000</pubDate>
		<guid isPermaLink="false">http://software-integrity.com/blog/?p=464#comment-107</guid>
		<description>Peter, a slightly different angle on the debate: If you are attempting to make the leanest possible system, and feature X can be eliminated, then consider eliminating it. If OTOH you want to make a rich system that gives users a choice of how they go about things, then consider including the feature even if it is &quot;redundant&quot;.

Getting a product accepted is about the user experience. That applies as much to an RTOS as to a toy like an iPad. Have you ever stood behind someone while they use a program you are a hot shot at, say Excel, and suddenly notice them doing something in quite a different way to how you would? That&#039;s richness.

The other argument in favour of richness is that it gives uses more opportunities to perhaps use the product in ways you, the maker, didn&#039;t anticipate. Which of course in an RTOS may not always be a Good Thing :-)

David Stonier-Gibson http://splatco.com</description>
		<content:encoded><![CDATA[<p>Peter, a slightly different angle on the debate: If you are attempting to make the leanest possible system, and feature X can be eliminated, then consider eliminating it. If OTOH you want to make a rich system that gives users a choice of how they go about things, then consider including the feature even if it is &#8220;redundant&#8221;.</p>
<p>Getting a product accepted is about the user experience. That applies as much to an RTOS as to a toy like an iPad. Have you ever stood behind someone while they use a program you are a hot shot at, say Excel, and suddenly notice them doing something in quite a different way to how you would? That&#8217;s richness.</p>
<p>The other argument in favour of richness is that it gives uses more opportunities to perhaps use the product in ways you, the maker, didn&#8217;t anticipate. Which of course in an RTOS may not always be a Good Thing <img src='http://software-integrity.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>David Stonier-Gibson <a href="http://splatco.com" rel="nofollow">http://splatco.com</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Thompson</title>
		<link>http://software-integrity.com/blog/2010/01/07/skc-no-semaphores/comment-page-1/#comment-96</link>
		<dc:creator>David Thompson</dc:creator>
		<pubDate>Wed, 20 Jan 2010 14:02:40 +0000</pubDate>
		<guid isPermaLink="false">http://software-integrity.com/blog/?p=464#comment-96</guid>
		<description>&lt;a href=&quot;#comment-93&quot; rel=&quot;nofollow&quot;&gt;@Peter Bushell  &lt;/a&gt; 
Surprisingly I came across rendezvous recently disguised under the term &quot;synchronous events&quot;, which, when explained, was something like &quot;I send you an event/message, you do something (whilst I wait) and then send me another event/message in response&quot;. So your kernel will cover this kind of pattern perfectly adequately.</description>
		<content:encoded><![CDATA[<p><a href="#comment-93" rel="nofollow">@Peter Bushell  </a><br />
Surprisingly I came across rendezvous recently disguised under the term &#8220;synchronous events&#8221;, which, when explained, was something like &#8220;I send you an event/message, you do something (whilst I wait) and then send me another event/message in response&#8221;. So your kernel will cover this kind of pattern perfectly adequately.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Bushell</title>
		<link>http://software-integrity.com/blog/2010/01/07/skc-no-semaphores/comment-page-1/#comment-95</link>
		<dc:creator>Peter Bushell</dc:creator>
		<pubDate>Tue, 19 Jan 2010 19:35:48 +0000</pubDate>
		<guid isPermaLink="false">http://software-integrity.com/blog/?p=464#comment-95</guid>
		<description>&lt;a href=&quot;#comment-91&quot; rel=&quot;nofollow&quot;&gt;@Dave Banham &lt;/a&gt; 
I looked at OSE some time ago, and Sciopta after reading your comment. While I like their approach in general, they both exhibit two things which I&#039;m trying to counter:

- Too many system calls
- Written in C

</description>
		<content:encoded><![CDATA[<p><a href="#comment-91" rel="nofollow">@Dave Banham </a><br />
I looked at OSE some time ago, and Sciopta after reading your comment. While I like their approach in general, they both exhibit two things which I&#8217;m trying to counter:</p>
<p>- Too many system calls<br />
- Written in C</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Bushell</title>
		<link>http://software-integrity.com/blog/2010/01/07/skc-no-semaphores/comment-page-1/#comment-94</link>
		<dc:creator>Peter Bushell</dc:creator>
		<pubDate>Tue, 19 Jan 2010 19:30:01 +0000</pubDate>
		<guid isPermaLink="false">http://software-integrity.com/blog/?p=464#comment-94</guid>
		<description>Jim &amp; Niall...

My sentiments, exactly. I mentioned the semaphore only because I imagined many people would expect to see such a thing in any RTOS. I appear to have been wrong about that, happily!</description>
		<content:encoded><![CDATA[<p>Jim &#038; Niall&#8230;</p>
<p>My sentiments, exactly. I mentioned the semaphore only because I imagined many people would expect to see such a thing in any RTOS. I appear to have been wrong about that, happily!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Bushell</title>
		<link>http://software-integrity.com/blog/2010/01/07/skc-no-semaphores/comment-page-1/#comment-93</link>
		<dc:creator>Peter Bushell</dc:creator>
		<pubDate>Tue, 19 Jan 2010 17:53:32 +0000</pubDate>
		<guid isPermaLink="false">http://software-integrity.com/blog/?p=464#comment-93</guid>
		<description>&lt;a href=&quot;#comment-82&quot; rel=&quot;nofollow&quot;&gt;@David Thompson &lt;/a&gt; 
Perhaps the concept of a rendezvous in Ada came about because the humble semaphore was in vogue at about the time the language was invented! I reluctantly have to conclude that the vanilla SKC++ won&#039;t be a good candidate for an Ada run-time system.

However, the inner heart of the kernel (downgraded to C), plus a semaphore (easy to code), plus some nasty POSIX, probably, would do the job :-)</description>
		<content:encoded><![CDATA[<p><a href="#comment-82" rel="nofollow">@David Thompson </a><br />
Perhaps the concept of a rendezvous in Ada came about because the humble semaphore was in vogue at about the time the language was invented! I reluctantly have to conclude that the vanilla SKC++ won&#8217;t be a good candidate for an Ada run-time system.</p>
<p>However, the inner heart of the kernel (downgraded to C), plus a semaphore (easy to code), plus some nasty POSIX, probably, would do the job <img src='http://software-integrity.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Banham</title>
		<link>http://software-integrity.com/blog/2010/01/07/skc-no-semaphores/comment-page-1/#comment-91</link>
		<dc:creator>Dave Banham</dc:creator>
		<pubDate>Sun, 17 Jan 2010 16:27:59 +0000</pubDate>
		<guid isPermaLink="false">http://software-integrity.com/blog/?p=464#comment-91</guid>
		<description>Have you had a look at the Enea OSE and Scipota RTOS API&#039;s. I&#039;m no expert but I believe that they are very message centric and do not provide the lower level primitives found in most other RTOS&#039;.</description>
		<content:encoded><![CDATA[<p>Have you had a look at the Enea OSE and Scipota RTOS API&#8217;s. I&#8217;m no expert but I believe that they are very message centric and do not provide the lower level primitives found in most other RTOS&#8217;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Niall Cooling</title>
		<link>http://software-integrity.com/blog/2010/01/07/skc-no-semaphores/comment-page-1/#comment-87</link>
		<dc:creator>Niall Cooling</dc:creator>
		<pubDate>Tue, 12 Jan 2010 14:38:16 +0000</pubDate>
		<guid isPermaLink="false">http://software-integrity.com/blog/?p=464#comment-87</guid>
		<description>I think it&#039;s great to remove semaphores from SKC++ for all the reasons you&#039;ve recounted, and hopefully it&#039;ll get people to think about what they&#039;re doing rather than how they&#039;re doing it.</description>
		<content:encoded><![CDATA[<p>I think it&#8217;s great to remove semaphores from SKC++ for all the reasons you&#8217;ve recounted, and hopefully it&#8217;ll get people to think about what they&#8217;re doing rather than how they&#8217;re doing it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim Cooling</title>
		<link>http://software-integrity.com/blog/2010/01/07/skc-no-semaphores/comment-page-1/#comment-83</link>
		<dc:creator>Jim Cooling</dc:creator>
		<pubDate>Fri, 08 Jan 2010 16:46:08 +0000</pubDate>
		<guid isPermaLink="false">http://software-integrity.com/blog/?p=464#comment-83</guid>
		<description>Just a personal point of view  -  I don&#039;t necessarily expect this to be a consensus opinion.

I&#039;m not sure how useful it is to look at items like semaphores, mutexs, etc. in isolation.  The primary question for the designer is &#039;what is the software trying to achieve?&#039; (e.g., passing information between concurrent units, synchronization of operations or protection of operations/data).  The next question: what is the &#039;best&#039; way of doing this?  Final question: what are the pros/cons of the chosen technique(s)?

Semaphores, mutexs, protected objects etc. are enabling mechanisms; their qualities should be assessed from this point of view.</description>
		<content:encoded><![CDATA[<p>Just a personal point of view  &#8211;  I don&#8217;t necessarily expect this to be a consensus opinion.</p>
<p>I&#8217;m not sure how useful it is to look at items like semaphores, mutexs, etc. in isolation.  The primary question for the designer is &#8216;what is the software trying to achieve?&#8217; (e.g., passing information between concurrent units, synchronization of operations or protection of operations/data).  The next question: what is the &#8216;best&#8217; way of doing this?  Final question: what are the pros/cons of the chosen technique(s)?</p>
<p>Semaphores, mutexs, protected objects etc. are enabling mechanisms; their qualities should be assessed from this point of view.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Thompson</title>
		<link>http://software-integrity.com/blog/2010/01/07/skc-no-semaphores/comment-page-1/#comment-82</link>
		<dc:creator>David Thompson</dc:creator>
		<pubDate>Fri, 08 Jan 2010 08:21:30 +0000</pubDate>
		<guid isPermaLink="false">http://software-integrity.com/blog/?p=464#comment-82</guid>
		<description>I was going to argue that counting semaphores must be needed for some architectures (maybe a pool of dedicated hardware processors) but thinking about it you can reproduce the behaviour at the application level with the features you provide.

Since I grew up with Ada however, I should make a case for rendezvous. There are certainly cases where the fact that you can exchange data between tasks __in both directions__ is very useful, and can avoid some of the anti-patterns you have mentioned - like loops of events going between tasks (A triggers B triggers C triggers A, etc.).

But as always, you are right - these situations normally occur because the architect hasn&#039;t thought about it enough.</description>
		<content:encoded><![CDATA[<p>I was going to argue that counting semaphores must be needed for some architectures (maybe a pool of dedicated hardware processors) but thinking about it you can reproduce the behaviour at the application level with the features you provide.</p>
<p>Since I grew up with Ada however, I should make a case for rendezvous. There are certainly cases where the fact that you can exchange data between tasks __in both directions__ is very useful, and can avoid some of the anti-patterns you have mentioned &#8211; like loops of events going between tasks (A triggers B triggers C triggers A, etc.).</p>
<p>But as always, you are right &#8211; these situations normally occur because the architect hasn&#8217;t thought about it enough.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Bushell</title>
		<link>http://software-integrity.com/blog/2010/01/07/skc-no-semaphores/comment-page-1/#comment-80</link>
		<dc:creator>Peter Bushell</dc:creator>
		<pubDate>Thu, 07 Jan 2010 22:24:13 +0000</pubDate>
		<guid isPermaLink="false">http://software-integrity.com/blog/?p=464#comment-80</guid>
		<description>&lt;a href=&quot;#comment-79&quot; rel=&quot;nofollow&quot;&gt;@Michael Barr &lt;/a&gt; 
Thanks for your comment, Michael.

In SKC++ the efficiency of the semaphore for signalling (actually slightly better) is obtained by using a bare event flag, without the overhead of an accompanying message where none is needed. However, I&#039;ve stuck my neck out by providing &lt;strong&gt;no&lt;/strong&gt; autonomous object which can stand in for a semaphore (say, for a rendezvous); both event groups and message queues are tied to and are effectively part of the particular tasks which wait at them.</description>
		<content:encoded><![CDATA[<p><a href="#comment-79" rel="nofollow">@Michael Barr </a><br />
Thanks for your comment, Michael.</p>
<p>In SKC++ the efficiency of the semaphore for signalling (actually slightly better) is obtained by using a bare event flag, without the overhead of an accompanying message where none is needed. However, I&#8217;ve stuck my neck out by providing <strong>no</strong> autonomous object which can stand in for a semaphore (say, for a rendezvous); both event groups and message queues are tied to and are effectively part of the particular tasks which wait at them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Barr</title>
		<link>http://software-integrity.com/blog/2010/01/07/skc-no-semaphores/comment-page-1/#comment-79</link>
		<dc:creator>Michael Barr</dc:creator>
		<pubDate>Thu, 07 Jan 2010 20:27:08 +0000</pubDate>
		<guid isPermaLink="false">http://software-integrity.com/blog/?p=464#comment-79</guid>
		<description>Your proposal is generally sound.  I certainly agree with the following aspects of what you said:

1.  That mutexes are superior to semaphores for mutual exclusion in a system with deadlines.  Only the mutex can prevent a priority inversion.

2.  That rendezvous is a bad idea.  If you are having that kind of coupling between two tasks, there is probably a more elegant solution to your overall software architecture.  It probably involves the passing of event ids via message queues.

In most respects, a message queue and a semaphore are identical constructs.  The message is always the same (whatever is agreed by sender and receiver) in the case of a semaphore.  This means the semaphore implementation is a more efficient subcase of the message queue.  If you don&#039;t care about the efficiency of the empty-message subcase of message queues, you can use a message queue for anything you would use a semaphore for (even rendezvous).

I&#039;ve written a few things on mutexes vs. semaphores in my blog at http://www.embeddedgurus.net/barr-code.  In addition, I&#039;m the host of a webinar on that subject at http://www.techonline.com.</description>
		<content:encoded><![CDATA[<p>Your proposal is generally sound.  I certainly agree with the following aspects of what you said:</p>
<p>1.  That mutexes are superior to semaphores for mutual exclusion in a system with deadlines.  Only the mutex can prevent a priority inversion.</p>
<p>2.  That rendezvous is a bad idea.  If you are having that kind of coupling between two tasks, there is probably a more elegant solution to your overall software architecture.  It probably involves the passing of event ids via message queues.</p>
<p>In most respects, a message queue and a semaphore are identical constructs.  The message is always the same (whatever is agreed by sender and receiver) in the case of a semaphore.  This means the semaphore implementation is a more efficient subcase of the message queue.  If you don&#8217;t care about the efficiency of the empty-message subcase of message queues, you can use a message queue for anything you would use a semaphore for (even rendezvous).</p>
<p>I&#8217;ve written a few things on mutexes vs. semaphores in my blog at <a href="http://www.embeddedgurus.net/barr-code" rel="nofollow">http://www.embeddedgurus.net/barr-code</a>.  In addition, I&#8217;m the host of a webinar on that subject at <a href="http://www.techonline.com" rel="nofollow">http://www.techonline.com</a>.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

