Timothee Maret created SLING-2540: ------------------------------------- Summary: Allow the ThreadPool to process Callable/Runnable and return a Future Key: SLING-2540 URL: https://issues.apache.org/jira/browse/SLING-2540 Project: Sling Issue Type: Improvement Components: Commons Affects Versions: Commons Threads 3.1.0 Reporter: Timothee Maret
Currently the sling's ThreadPool [0] is not returning a Future when executing a task. However, having a handle on the future result of the computation is useful for cases requiring fine grained synchronization among tasks. For instance, one could require to execute tasks mixing parallel and sequential execution (Barrier synchronization). As an example, we could take the following queue of tasks: queue: -->(task1)-->(task2, task3, task4)-->(task5)-->(task6,task7) Group of tasks = (task1, …, taskn) Groups of tasks are executed sequentially Tasks in a group are executed in parallel This could be easily implemented based on the Future objects returned by the ThreadPool. Thus, it would be nice to enable it. [0] org.apache.sling.commons.threads.ThreadPool -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira