[concurrency-interest] Fork and and timed get

Martin Buchholz martinrb at google.com
Thu Nov 21 02:35:28 EST 2013


Your message got ignored...

You created a pool with parallelism of 1, so it's not surprising that no
new thread was created to run action1.  The action of the pool seems
reasonable to me - how would you do better?

Also, posting your code with a friendlier legal notice might help.


On Mon, Nov 18, 2013 at 8:35 AM, Jonathan Soto <jso at quartetfs.com> wrote:

> Hello everyone,
> It has been a few days I am thinking about this problem. Could you help me
> ?
>
> Suppose that we have two tasks
> - task1 waits for 5s
> - task2 forks task1 and does a timed get of 2.5 seconds
>
> The main thread submits task2 to a FJP.
>
> I observe the following behavior.
> - Thread Main   :
> FPJ.submit(task2)
>
> - Thread FJPO-1 : task1.fork
> As we are in the FJP it adds task1 into the workQueue of the current thread
> Task1 does not start in another thread
>
> - Thread FJPO-1 : task1.get(2.5, SECONDS)
> Starts by checking if the current thread has some local tasks to be done.
> As there is task1 that has been previously stored, we execute it.
>
> Task1 takes 5 seconds to be executed. The 2.5 seconds timeout is totally
> ignored.
>
> Is that the expected behavior ?
>
> Thanks
>
> Jonathan
>
> P.s in attachment a unit test that prints FAIL when the test fails
>
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20131120/aaf5bd1e/attachment-0001.html>


More information about the Concurrency-interest mailing list