<?xml version="1.0" encoding="UTF-8"?>

<rdf:RDF 
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns="http://purl.org/rss/1.0/"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:syn="http://purl.org/rss/1.0/modules/syndication/"
>

  <channel rdf:about="http://lwn.net/headlines/167034/">
    <title>LWN: Comments on "The mutex API"</title>
    <link>http://lwn.net/Articles/167034/</link>
    <description>
This is a special feed containing comments posted
to the individual LWN article titled &quot;The mutex API&quot;.

    </description>

    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>2</syn:updateFrequency>
    <items>
      <rdf:Seq>
	<rdf:li resource="http://lwn.net/Articles/167355/rss" />
      
      </rdf:Seq>
    </items>

  </channel>
    <item rdf:about="http://lwn.net/Articles/167355/rss">
      <title>The mutex API</title>
      <link>http://lwn.net/Articles/167355/rss</link>
      <dc:date>2006-01-12T09:41:39+00:00</dc:date>
      <dc:creator>simlo</dc:creator>
      <description>
      &lt;I&gt; Note that mutex_unlock() cannot be called from interrupt context. This restriction appears to have more to do with keeping mutexes from ever being used as completions than a fundamental restriction caused by the mutex design itself.&lt;/I&gt; &lt;p&gt;

If you could it would not be a mutex but a semaphore! A mutex can only be
unlocked by the owner - which must be a task. But when you turn off the debug code, Ingo's mutex is indeed just a binary semaphore. &lt;p&gt;

At computer science we were indeed told to use binary semaphores as mutual exclusion locks. But it is a bad advice. The semantics is very different. To help debugging and make the code more understandable it is really a good idea to use seperate types for completion type semaphores and mutex and to enforce the mutex semantics. On real-time systems you must use a mutex with some kind of priority inversion prevention (priority inheritance or priority ceiling). Therefore it is essential not to mix up mutex with completions on that kind of systems.&lt;p&gt;

Furthermore: When a mutex can't be touched from interrupts, you don't have
to disable interrupts while performing mutex operations.

      
      </description>
    </item>
</rdf:RDF>

