|
From: Anthony E. <me...@an...> - 2002-08-15 12:30:09
|
I see what you are saying. I was sort of worried about issues with using a stack to store the thread sets, but I am really not sure how else to do it. Any thoughts? -Anthony > -----Original Message----- > From: obe...@li...=20 > [mailto:obe...@li...] On Behalf=20 > Of Chunyang Ye > Sent: Thursday, August 15, 2002 1:39 AM > To: obe...@li... > Subject: [Obe-developer] question about the JoinMonitor >=20 >=20 > Dear Anthony Eden,I have a question about the JoinMonitor.In=20 > the implementation, when an AND split occurs,each new created=20 > thread is added to a new created ThreadSet=20 > and the ThreadSet is pushed onto the current process=20 > instance's stack.when a join is=20 > reached,the top thread set is popped off of the stack and a=20 > joinMonitor is created. I don't think the ThreadSet popped=20 > off the stack is just the ThreadSet of current=20 > activity's former activities's thread set.For example,the=20 > following case could not work: > =20 > (1) | | > / \ | | > (2) (3) ThreadSet1 | | > / \ / |------------| > ThreadSet2 (4) (5) / | ThreadSet2 | > \ / / |------------|=20 > \ / / | ThreasSet1 | > ( 6 ) -------------- > =20 > When activity 1 is finished,an AND split occurs,ThreadSet1 is=20 > created and threads of=20 > activity2 and activity3 is added to ThreadSet1.Then=20 > ThreadSet1 is pushed onto stack, activity2 and activity3 are=20 > concurrently executed.Maybe activity3 has a long time to=20 > run and activity2 is finished quickly.So another AND split=20 > occurs,ThreadSet2 is created, include threads of activity4=20 > and activity5, and pushed onto stack.when activity4 and=20 > activity5 are finished,activity3 hasn't been finished=20 > yet,then an AND join occurs. ThreadSet2 is popped off the=20 > stack and a JoinMonitor is created.Because the threads in=20 > ThreadSet2 are all terminated,the JoinMonitor is stopped and=20 > activity6 is executed, but activity3 isn't finished yet,and=20 > activity6 shouldn't be executed. > =20 > Sincerely, > Chunyang Ye > N=B1=B5=8A=B2=B2uH=8A=A1j=99u=96=9D=B5=C2y=15=86=B3=C3=A6=89=9B >=20 |