[concurrency-interest] Fork and and timed get

Jonathan Soto jso at quartetfs.com
Mon Nov 18 11:35:13 EST 2013

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   :

- 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

Is that the expected behavior ?



P.s in attachment a unit test that prints FAIL when the test fails
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20131118/cfc410ee/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestForkTimedGet.java
Type: application/octet-stream
Size: 1595 bytes
Desc: not available
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20131118/cfc410ee/attachment.obj>

More information about the Concurrency-interest mailing list