[concurrency-interest] JCJP Memoizer pattern

Bryan Thompson bryan at systap.com
Tue Mar 30 07:45:53 EDT 2010


Hello,

We've been using the "Memoizer" pattern from JCIP and run into a problem where an interrupt of the thread actually running the Computable is essentially propagated to all tasks awaiting the same Computable.  This was easy enough to fix by adding a flag indicating whether the thread awaiting the Future was the thread which actually ran the task.  If so, then we propagate the interrupt.  Otherwise we remove the FutureTask from the cache and retry, essentially discarding the interrupt for other callers.

Bryan



More information about the Concurrency-interest mailing list