Provided by Luis Lavena.
* newpool: fix backtrace suppression for rubinius use new process for testing. add .rbx directory to ignore list pull thread startup/shutdown into separate method Removed inaccurate statistic about a thread awake. Changed statistics to read more like a sentence. Fixed small bug in ThreadHistoryDisplay where it made a default :data value that should be a Hash. de-lambda-fied the promise object. add ThreadPool::Promise add comment to assert should use value for futures (not call) more with promise_complete? whitespace add promise_complete? method improve order independence in test ThreadPool threads no longer sleep on futures. Added some instrumentation to retieve stats from the threadpool
value that should be a Hash.
Previously, the ThreadPool created futures and added them to the queue. If, when they processed a future and they had to wait for it to finish executing, they would spawn another thread so they could wait for the future. Now, a non-blocking attempt to process the future's block is what is put on the queue and a blocking attempt is passed back from #future. In this way, the thread pool is free to process the core of a future by dequeuing it and calling it. The the thread can't get the lock, it is assumed that another thread is handling it and so it moves to the next.