[concurrency-interest] Single-threaded ForkJoinPool

cowwoc cowwoc at bbs.darktech.org
Sun Feb 21 15:33:10 EST 2016


+1 for the updated documentation.

Looking forward to hearing more about the ForkJoinPool control/turning 
parameters you have in mind.

Thanks,
Gili

On 2016-02-21 3:18 PM, Doug Lea [via JSR166 Concurrency] wrote:
>
> Sorry for the delay...
>
> On 02/11/2016 11:35 PM, cowwoc wrote:
>
> > As an aside, do you plan on fixing tryAddWorker() so it retries 
> launching a new
> > thread if one is still needed?
>
> It's a feature (not a bug) also used in ThreadPoolExecutor
> to avoid infinitely looping failures (including for example
> OutOfMemoryErrors):
> A failed (null or exceptional) call to newThread is not
> retried until the next opportunity to call it.
> We should clarify the documentation, as below.
>
> Not directly relevantly, but I'm also finally getting to think
> that we should add some control/tuning parameters to ForkJoinPool.
> More on that soon.
>
>
>      /**
>       * Factory for creating new {@link ForkJoinWorkerThread}s.
>       * A {@code ForkJoinWorkerThreadFactory} must be defined and used
>       * for {@code ForkJoinWorkerThread} subclasses that extend base
>       * functionality or initialize threads with different contexts.
>       */
>      public static interface ForkJoinWorkerThreadFactory {
>          /**
>           * Returns a new worker thread operating in the given pool.
>           * Returning null or throwing an exception may result in tasks
>           * never being executed.  If this method throws an exception,
>           * it is relayed to the caller of the method (for example
>           * {@code execute}) causing attempted thread creation. If this
>           * method returns null or throws an exception, it is not
>           * retried until the next attempted creation (for example
>           * another call to {@code execute}).
>           *
>           * @param pool the pool this thread works in
>           * @return the new worker thread, or {@code null} if the request
>           *         to create a thread is rejected.
>           * @throws NullPointerException if the pool is null
>           */
>          public ForkJoinWorkerThread newThread(ForkJoinPool pool);
>      }
>
>
> _______________________________________________
> Concurrency-interest mailing list
> [hidden email] </user/SendEmail.jtp?type=node&node=13264&i=0>
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>
>
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the 
> discussion below:
> http://jsr166-concurrency.10961.n7.nabble.com/Single-threaded-ForkJoinPool-tp13232p13264.html 
>
> To unsubscribe from Single-threaded ForkJoinPool, click here 
> <http://jsr166-concurrency.10961.n7.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=13232&code=Y293d29jQGJicy5kYXJrdGVjaC5vcmd8MTMyMzJ8MTU3NDMyMTI0Nw==>.
> NAML 
> <http://jsr166-concurrency.10961.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> 
>





--
View this message in context: http://jsr166-concurrency.10961.n7.nabble.com/Single-threaded-ForkJoinPool-tp13232p13266.html
Sent from the JSR166 Concurrency mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20160221/6dc4d70a/attachment.html>


More information about the Concurrency-interest mailing list