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

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Jun 7 11:19:21 UTC 2013


On 06/07/2013 02:38 AM, Chris Johns wrote:
> 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.

I would like to keep the names Acquire/Release like in smplock.h

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the devel mailing list