[concurrency-interest] thread queueing qn
Dhanji R. Prasanna
dhanji at gmail.com
Mon Jan 21 21:20:38 EST 2008
On 1/22/08, David Holmes <dcholmes at optusnet.com.au> wrote:
> No it doesn't mean that. There's no guarantee of FIFO access to a
> synchronized region.
I don't think I follow. Let's do this in the abstract (i.e. not necessarily
Threads: [A, B] Locks: [L]
- Thread A acquires L
- Thread B attempts L, but L is locked, so it blocks
- Thread A completes critical section and releases L
- Thread B is notified, and continues into the critical section
A came first, A exited first. B came last, B exited last.
Does j.u.c.l.Lock or java monitors not guarantee such ordering (i.e. on
acquisition or release of locks)?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest