[concurrency-interest] On park and unpark

Nathan and Ila Reynolds nathanila at gmail.com
Fri Aug 25 12:49:47 EDT 2017

Several years ago, I saw Linux futex perform poorly in the kernel.  
Futex was getting a bad rap by others as well.  In my experience, the 
kernel would spend a lot of CPU time dealing with futexes.  I do not 
remember the circumstances that cause this scenario.  So, I recommend 
proceeding with caution and lots of testing.  Perhaps, this caution is 
not warranted and the problem was fixed in the kernel.

For the blocking case, I would guess there would not be much difference 
in performance.

I recommend running some microbenchmark tests for the non-blocking case 
(i.e. unpark() before park()).  You might see a CPU performance gain.


On 8/25/2017 10:28 AM, Doug Lea wrote:
> On 08/25/2017 11:12 AM, Andrew Haley wrote:
>> On 25/08/17 12:12, Doug Lea wrote:
>>> 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.
>> I've done it, and could not measure any difference.
> Well, it should still save a few electrons (or millions, across
> deployments), so still seems to be the Right Thing to do.
> -Doug
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest


More information about the Concurrency-interest mailing list