You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Timothee Maret (JIRA)" <ji...@apache.org> on 2012/07/18 14:58:33 UTC

[jira] [Created] (SLING-2540) Allow the ThreadPool to process Callable/Runnable and return a Future

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

       

[jira] [Assigned] (SLING-2540) Allow the ThreadPool to process Callable/Runnable and return a Future

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-2540?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler reassigned SLING-2540:
---------------------------------------

    Assignee: Carsten Ziegeler
    
> 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
>            Assignee: Carsten Ziegeler
>         Attachments: SLING-2540.patch
>
>
> 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

       

[jira] [Resolved] (SLING-2540) Allow the ThreadPool to process Callable/Runnable and return a Future

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-2540?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler resolved SLING-2540.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: Commons Threads 3.2.0

Thanks for the patch, Timothee. I've applied it to the current trunk in a slightly modified way (logging).
I've not changed the eventing module as this one is built based on the old released version of the thread pool
                
> 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
>            Assignee: Carsten Ziegeler
>             Fix For: Commons Threads 3.2.0
>
>         Attachments: SLING-2540.patch
>
>
> 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

       

[jira] [Updated] (SLING-2540) Allow the ThreadPool to process Callable/Runnable and return a Future

Posted by "Timothee Maret (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-2540?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timothee Maret updated SLING-2540:
----------------------------------

    Attachment: SLING-2540.patch

The patch adds the following methods to ThreadPool:

* <T> Future<T> submit(Callable<T> callable);
* Future<?> submit(Runnable runnable);

Please adjust the dependencies in the pom.xml.
                
> 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
>         Attachments: SLING-2540.patch
>
>
> 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