[concurrency-interest] Fork and and timed get

√iktor Ҡlang viktor.klang at gmail.com
Wed Nov 27 15:03:35 EST 2013


On Wed, Nov 27, 2013 at 11:01 AM, Doug Lea <dl at cs.oswego.edu> wrote:

> On 11/27/2013 11:09 AM, Romain Colle wrote:
>
>  The basic idea here is that, as far as I can tell, the get(long timeout,
>> TimeUnit unit) method of a ForkJoinTask does not respect the Future
>> contract.
>>
>>
> Well, it does meet spec in that it times out no earlier than required.
>
>
>  Before blocking and waiting for the task to complete, the timed get()
>> method
>> tries to either steal and execute the task, or at least help it complete.
>> If it succeeds doing so, it will for instance execute the task that it is
>> waiting for. And in this case, there is no telling how long it will take
>> to
>> execute it ...
>>
>
> Yes. Given the documentation of FJ, people ought to expect this
> and would claim it to be a bug if it did otherwise. Maybe we
> should add better method documentation for timed get, and also
> explain a few ways to get non-participatory timeouts.
> For example, creating a new thread to perform the invocation
> and timing out on Thread.join. Suggestions welcome.


Have ``get`` use managed blocking? Is that an option?

Cheers,
√


>
>
> -Doug
>
>
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>



-- 
Cheers,
√

*Viktor Klang*
*Director of Engineering*
Typesafe <http://www.typesafe.com/>

Twitter: @viktorklang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20131127/d2e95af9/attachment-0001.html>


More information about the Concurrency-interest mailing list