|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjsync.Concurrent
Class initiating parallel execution of several threads and collecting their results. Two models of execution are supported - wait completion of all activities or wait until some thread is terminated and stop all other threads.
Activity
Constructor Summary | |
Concurrent(Activity[] activities)
Constructor of Concurrent class. |
Method Summary | |
void |
start()
Start execution of activity threads. |
java.lang.Object[] |
waitAll()
Wait until all started threads finish their execution. |
java.lang.Object[] |
waitAll(long timeout)
Wait at most timeout miliseconds until all started
threads finish their execution. |
java.lang.Object |
waitOne()
Wait until one of the started threads finish it's execution. |
java.lang.Object |
waitOne(long timeout)
Wait during specified period of time until one of started threads finish it's execution. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Concurrent(Activity[] activities)
Concurrent
class. This constructor creates
a thread object for each activity.
activities
- array of activities to be done.Method Detail |
public void start()
public java.lang.Object waitOne()
public java.lang.Object waitOne(long timeout)
timeout
- the maximum time to wait in milliseconds.
null
if timeout is expired before any thread finish it's
execution.public java.lang.Object[] waitAll()
public java.lang.Object[] waitAll(long timeout)
timeout
miliseconds until all started
threads finish their execution.
timeout
- the maximum time to wait in milliseconds.
null
if timeout is expired before all threads finish
execution.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |