[genode] [feature request] Lock and RW lock function for Genode Thread support.
Norman Feske
norman.feske at ...1...
Mon Aug 6 20:13:25 CEST 2012
Hello Eunseok Kim,
welcome to the mailing list! :-)
> We wana change to Genode thread from pthread of Fawn Source.
> But, we have some problem how to convergen lock and RW lock of Pthread.
> Could you tell me which lock function is appropriate to use for lock and RW lock
> in the Genode Thread?
There is currently no distinction between an rw-lock and a plain lock.
There is just the 'Lock' class. The important pieces are:
The interface:
https://github.com/genodelabs/genode/blob/master/base/include/base/cancelable_lock.h
The generic implementation:
https://github.com/genodelabs/genode/blob/master/base/src/base/lock/lock.cc
The platform-specific back-end functions are located at the
'base-<platform>/src/base/lock/lock_helper.h' file.
The basic functioning of the lock is described in the following posting
at the L4ka::Pistachio mailinglist:
https://lists.ira.uni-karlsruhe.de/pipermail/l4ka/2010-July/002318.html
So far, we hadn't had the urgent need for a rw-lock in Genode. In
principle, you should be safe to use the normal 'Lock' in cases where an
rw-lock is normally used. The code will probably just scale not as good
as by using an rw-lock when the lock is contended by multiple readers.
Alternatively, you may consider implementing an rw-lock by following the
lines of the 'Genode::Lock' and using the same backend function
interface (the functions provided by 'lock_helper.h'). If you take this
path, I would be very interested in your findings.
Best regards
Norman
--
Dr.-Ing. Norman Feske
Genode Labs
http://www.genode-labs.com · http://genode.org
Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth
More information about the users
mailing list