Core Mutex Strict Order Release Support

Kim Barrett kab.conundrums at verizon.net
Tue Jun 21 00:35:36 UTC 2011


On Jun 20, 2011, at 6:09 PM, Joel Sherrill wrote:
> It is a test for the code which enforces releasing
> priority ceiling and inheritance mutexes in order.
> You would get an error for the following code
> fragment:
> 
>  obtain(sem1)
>    obtain(sem2)
>    release(sem1)
>  release(sem2)
> 
> 
> How does the community feel about this getting
> turned on by default?


I'm only a lurker, and not an actual rtems users, but why would you
want to make this change?  I've even written real code that did this
sort of thing.  Something like the following (from memory, I didn't
track down actual code)

linked list of objects protected by mutex.
each object has an associated mutex that protects certain operations,
including removal from the linked list and associated deletion.

obtain(mutex for linked list)
search linked list for objectA
obtain(mutex for objectA)
release(mutex for linked list)
... do stuff with objectA, allowing other threads to scan list and
    operate on other objects
release(mutex for objectA)




More information about the users mailing list