[concurrency-interest] Fork and and timed get

√iktor Ҡlang viktor.klang at gmail.com
Fri Nov 29 08:05:03 EST 2013


On Thu, Nov 28, 2013 at 7:24 AM, Romain Colle <rco at quartetfs.com> wrote:

> Hi Doug and all,
>
> On Wed, Nov 27, 2013 at 8:01 PM, Doug Lea <dl at cs.oswego.edu> wrote:
>
>> Well, it does meet spec in that it times out no earlier than required.
>>
>
> As far as I can tell, the javadoc for get(long, TimeUnit) reads: "Waits
> if necessary for at most the given time for the computation to complete,
> and then retrieves its result, if available. "
> I would therefore expect it to return no later than when the given timeout
> has expired.
>
>  On Wed, Nov 27, 2013 at 8:01 PM, Doug Lea <dl at cs.oswego.edu> wrote:
>
>> 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.
>
>
> Agreed. However, I'd really like the thread management to be handled by
> the pool, exactly the way it is done today after trying to help the task in
> get():
> tryCompensate() / set SIGNAL / wait / incrementActiveCount().
> This is in fact doing exactly the managed block that Viktor suggested.
>

Isn't there a difference in that it doesn't spawn an additional thread?

Cheers,
√


>
> Basically what I need is a version of get(long, TimeUnit) that simply does
> not try to help :-)
>
> Thanks!
>
> --
> Romain Colle
> R&D Project Manager
> QuartetFS
> 2 rue Jean Lantier, 75001 Paris, France
> http://www.quartetfs.com
>
> _______________________________________________
> 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/20131129/428de65e/attachment-0001.html>


More information about the Concurrency-interest mailing list