[concurrency-interest] Canceling Futures - Callable implementations

Gregg Wonderly gregg at cytetech.com
Thu Apr 9 15:12:28 EDT 2009


Joe Bowbeer wrote:
> I was wondering if Thread.yield would raise a flag.  (If this were a 
> real code sample, it should raise a flag.)

I use Thread.yield as a concurrency test mechanism.  I've found that if  you are 
tightly spinning the CPUs on multiple threads which have concurrent access 
behaviors that occasionally I can find some unintended contention and even 
sometimes some concurrency bugs by yielding in places which let dispatched 
threads of execution start sooner rather than later, at quantum exhaustion etc.

Gregg Wonderly


More information about the Concurrency-interest mailing list