[concurrency-interest] On park and unpark

Doug Lea dl at cs.oswego.edu
Fri Aug 25 07:12:45 EDT 2017

On 08/25/2017 05:37 AM, Andrew Haley wrote:
> At the bottom of every blocking operation in j.u.c is the park/unpark
> pair.  I'm curious about the choice of these primitives. 

They were introduced by Dave Dice (in hotspot) and me (in j.u.c
in the original jsr166), as the most OS-independent low-level blocking
primitives we could imagine -- it is a leaky one-bit semaphore,
inspired in part from some 1990s DEC SRC papers. My 2004 AQS paper
http://gee.cs.oswego.edu/dl/papers/aqs.pdf includes some discussion.

BTW, on linux, it should be more efficient to implement using
Futex instead of the current scheme based on original Solaris
version. But no one has ever volunteered to do this.


More information about the Concurrency-interest mailing list