[PATCH 9/9] score: Add and use _Objects_Release()

Chris Johns chrisj at rtems.org
Fri Jun 7 00:38:04 UTC 2013


Sebastian Huber wrote:
> On 06/05/2013 05:22 PM, Sebastian Huber wrote:
>> Add and use _Objects_Release_without_thread_dispatch(). These two
>> functions pair with the _Objects_Get() function. This helps to
>> introduce object specific SMP locks to avoid lock contention.
>
> Maybe it is better to name it _Objects_Put(). So we have
>
> obj = _Objects_Get()
> do_something_with_it(obj)
> _Objects_Put(obj)
>
> For SMP it is desirable to gradually introduce more fine grained
> locking. So we may add a SMP lock to Objects_Control and use new
> functions _Objects_Acquire() and _Objects_Release() to protect the
> object state. For example a mutex obtain may use only the object
> specific lock if it is free and use additional locks if it has to
> perform a blocking operation which requires intervention of the scheduler.
>

Why not change get/put to _Objects_Acquire() and _Objects_Release() and 
then change acquire/release to _Objects_Unlock() and _Objects_Unlock() ?

The fact a lock returns a locked object is a feature of locking. It does 
not need to be the name of the call.

Chris



More information about the devel mailing list