DragonFly BSD
DragonFly kernel List (threaded) for 2004-02
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: lkwt in DragonFly

From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 9 Feb 2004 01:33:00 -0800 (PST)

:>     If you want something that stays valid through a switch or a blocking
:>     condition then you would need to use a lockmgr lock.  If you just
:>     need atomicy across a short period of time in which you know the
:>     thread will not block, or in a situation where the code does the 
:>     right thing if another piece of code operates on the same
:>     data structure while the first piece is blocked, then a token
:>     would be sufficient.
:That's the thing I need, thanks !
:And sorry a bit OT, what's the plan of pthread supports in DFly, I am
:very interested to work on it in near future.
:David Xu

   If you think about it, the vast majority of things you might need
   to serialize tend to be small, short sections of code.  e.g. in 
   FreeBSD a mutex is used to serialize access to the contents of the
   lock datastructure (not to implement the lock itself, mind you, simply
   to protect manipulation of elements within the lock data structure).
   In FreeBSD you have no choice but to use a mutex due to its anything-can-
   preempt-anything threading model.  But in DFly a token would be quite
   sufficient for these small manipulations and that is precisely what we

					Matthew Dillon 

[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]