A question on parallel
david.holmes at oracle.com
Mon Aug 26 21:01:05 PDT 2013
On 27/08/2013 1:51 AM, Jose wrote:
> Fair enough,
> if the EDT is going to be blocked anyway until the operation completes, it
> makes sense to use it in the meantime as a working thread.
Ummm you _don't_ want the EDT to block! Anyone who thinks they need to
launch a parallel operation from an event handler needs to fork it off
to another thread, just like any long-running or potentially blocking
> Thanks for the info
> -----Mensaje original-----
> De: Brian Goetz [mailto:brian.goetz at oracle.com]
> Enviado el: lunes, 26 de agosto de 2013 17:36
> Para: Jose
> CC: lambda-dev at openjdk.java.net
> Asunto: Re: A question on parallel
> The streams framework has no awareness of "special" threads like EDT.
> EDT is the initiating thread, no different from any other thread.
> When you initiate a terminal stream operation (sequential or parallel), the
> initiating thread is blocked until the operation completes. If the
> computation is parallel, the initiating thread may get coopted into being a
> worker thread.
> - No special behavior for EDT
> - The seq/par distinction is indistinguishable from the EDT's perspective,
> since both block until the operation is done.
> Even if the initiating thread didn't temporarily join the worker pool, the
> EDT would still be blocked.
> On 8/26/2013 11:20 AM, Jose wrote:
>> When running a parallel pipeline form the EDT, which policy
>> determimine which tasks will run on the EDT?
>> There is a way to make all the resulting tasks to run in working threads?
More information about the lambda-dev