DragonFly kernel List (threaded) for 2004-04
Re: lwkt_token progress
On Sat, 21 Feb 2004, Matthew Dillon wrote:
> Serializing Tokens
> A serializing token may be held by any number of threads simultaniously.
> A thread holding a token is guarenteed that no other thread also
> holding that same token will be running at the same time.
> A thread may hold any number of serializing tokens.
> A thread may hold serializing tokens through a thread yield or blocking
> condition, but must understand that another thread holding those tokens
> may be allowed to run while the first thread is not running (blocked or
> yielded away).
> There are theoretically no unresolvable deadlock situations that can
> arise with the serializing token mechanism. However, the initial
> implementation can potentially get into livelock issues with multiply
> held tokens.
> Serializing tokens may also be used to protect threads from preempting
> interrupts that attempt to obtain the same token. This is a slightly
> different effect from the Big Giant Lock (also known as the MP lock),
> which does not interlock against interrupts on the same cpu.
> Holding a serializing token does NOT prevent preemptive interrupts
> from occuring, though it might cause some of those interrupts to
This seems like a very nice scheme. My initial gut feeling was that it
could potentially lower the error rate for coding against this scheme
compared, say, to the correct application of mutex+lock.
How common are "blocking conditions", though? It occurred to me that
the ease of using serialisation tokens might lead to their prevalence;
have you anything in mind to avoid the situation where a code path
suddenly potentially blocks due to a modification of some function it
(opaquely) depends upon due to a deep call graph?
By "something in mind" I mean some kind of guideline for best use of
jan grant, ILRT, University of Bristol. http://www.ilrt.bris.ac.uk/
Tel +44(0)117 9287088 Fax +44 (0)117 9287112 http://ioctl.org/jan/
Usenet: The separation of content AND presentation - simultaneously.