Hi All,


It appears that my issues with this particular problem or bug is not yet fully resolved. Attached is a PN workflow containing exactly six actors--two Ramp actors and four Expression actors. I don't think there should be any loops or any actor that should take a long time to execute, but the workflow never transitions from "executing" to "execution finished." I've tested this against Ptolemy II 4.0.1, the current CVS HEAD, and against a version that includes the patch I sent last week.

I'm currently trying to create a much larger workflow (there are about 400 threads => 400 instantiations of actors), and I'm seeing some kind of race condition that causes all actors to be blocked, though they shouldn't be, and yet PN doesn't switch to the execution finished state either. I'm hoping the final fix to this problem on this small workflow will solve the problem on the larger one as well, so any help is appreciated.


Thanks, Xiaowen



Attachment: TwoRampBlock.xml
Description: Binary data




On 10.02.2005, at 14:35, xiaowen wrote:

Hi,


I think I see where the problem is.

A single PNQueueReceiver may have multiple actors/threads trying to call its put() method--this is the case when there's a relation connecting the output of one actor to the input ports of multiple actors. If the size of the queue is not big enough, two threads may both block on the write and inform PNDirector that the queue is write blocked. This leads the director to believe that two different queues are blocked instead of one. Later, when the capacity of the queue is increased or a token is read and removed from it, the number of write-blocked queues is only decremented once by the director. Thus the workflow never terminates because it always thinks there's a write-blocked queue.

Here's a diff against PNQueueReceiver.java in Ptolemy II CVS that seems to fix the problem:

$ diff ~/work/ptII/ptolemy/domains/pn/kernel/PNQueueReceiver.java PNQueueReceiver.java
420,421c420,423
< _writeBlocked = true;
< prepareToBlock(branch);
---
> if (false == _writeBlocked) {
> _writeBlocked = true;
> prepareToBlock(branch);
> }


Perhaps the get() method also requires something similar. With this change, the queue only informs the director that it's blocking on write once. It seems to make the workflow I sent earlier work correctly. If you agree this patch works, then please apply to ptII CVS.


Thanks, Xiaowen



On 08.02.2005, at 19:53, xiaowen wrote:

Hi Everyone,


Attached please find a small workflow that doesn't appear to finish correctly. It is meant to write a short string to some files and immediately finish. However, it seems to stay in the "executing" state and never switches to the "execution finished" state. Will you please take a look and tell me what I'm missing?


Thanks! Xiaowen




<execute.xml>


----------------------------------------------------------------------- -----
Posted to the ptolemy-hackers mailing list. Please send administrative
mail for this list to: [EMAIL PROTECTED]

Reply via email to