RE: parallel processes and thread.sleep

"He Wei" <[email protected]> Wed, 17 Aug 2005 14:36:52 +0800
Newsgroups gmane.comp.java.enhydra.shark
Message-ID <20050817063659.GPRO1195.morpheus2.pacific.net.sg@weihenb>
Dear Vlada,

Regarding to the question in the email below, could you please kindly
explain more how to "let your application start a new Thread for those 5
instances" to make it *really* parallel?
Thank you very much.
Best Regards,
He Wei

-----Original Message-----
From: Vladimir Puskas [mailto:[email protected]] 
Sent: Wednesday, July 20, 2005 4:55 PM
To: [email protected]
Subject: Re: [shark] parallel processes and thread.sleep

Hello Sebastian

you wrote:
> hi list,
>  
> i try to realise some parallel processes (instances) and each of them
> uses the javascript-agent with java.lang.thread.sleep(20000). after that
> break, the process sends an email. now, i have the following problem:
> i start 5 processes at the same time.
> the first process starts, waits 20 seconds and sends an email.
> then, after that 20 seconds, the second process waits 20 seconds and
> sends an email.
> then, after 40 seconds, the thrid process waits 20 seconds and sends an
> email.
> ...
> is it possible, that all the processes start at the same time, wait 20
> seconds and send then an email? i tried the beer pause example too -
> same result.

POJO Shark is library, so it won't open a new thread to execute process.
If your tool-agent says sleep 20sec Shark will obey, and your
application will too, that's why these process instances were executed 
in sequence :-)

To make it *really* parallel let your application start a new Thread for
those 5 instances, or use Scheduler tool-agent in your xpdl (like
test-Scheduler.xpdl).

hope this helps
-- 
Vlada
message-footer.txt (text/plain, 271 B)
--
You receive this message as a subscriber of the [email protected] mailing list.
To unsubscribe: mailto:[email protected]
For general help: mailto:[email protected]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws