[concurrency-interest] Blocking vs. non-blocking

Aleksey Shipilev aleksey.shipilev at oracle.com
Sat Jun 14 15:04:17 EDT 2014


On 14.06.2014, at 1:57, Doug Lea <dl at cs.oswego.edu> wrote:

> Your best case of approximately 20 thousand clock cycles is not an
> unexpected result on a single-socket multicore with all cores turned
> on (i.e., no power management, fusing, or clock-step effects)
> and only a few bouncing cachelines

+1. The empirical rule of thumb we figured in early JDK 8 work was that you need around 50 us to wakeup the thread on Linux and Solaris (i.e. at least 50us passes since the wakeup request like LockSupport.unpark before thread starts executing after wakeup).

> We've seen cases of over 1 million cycles to unblock a thread
> in some other cases. (Which can be challenging for us to deal
> with in JDK8 Stream.parallel(). I'll post something on this sometime.)
> Maybe Aleksey can someday arrange to collect believable
> systematic measurements across a few platforms.

Yeah, I should definitely do that some time this summer.

Crawling back to enjoy my vacation,
-Aleksey


More information about the Concurrency-interest mailing list