June 2017
Beginner to intermediate
274 pages
6h 49m
English
The future object will remember that function and when the job function is done, the callback function will be called with the future object as its only parameter. The code in the callback function can then call the future's result method to get the return value or exception that the job produced.
When we use add done callback, we need to be careful of thread synchronization issues, which is a big reason to prefer the wait or as_completed functions when possible. The future objects also have a cancel method.
Read now
Unlock full access