aleph
Class RemoteThread
java.lang.Object
|
+--aleph.RemoteThread
- Direct Known Subclasses:
- Matrix.UserThread
- public abstract class RemoteThread
- extends java.lang.Object
- implements java.lang.Runnable, java.io.Serializable
The base class for remote threads.
Unlike java.lang.thread, one can create a single RemoteThread object,
and fork it multiple times at one or more PEs.
For example, a remote thread that prints a message could be written as follows.
class HelloThread extends RemoteThread {
public void run() {
System.out.println("Hello world!");
}
}
The following code would then create a remote thread, start it at all PEs,
and then wait until all instances finished.
for (Enumeration e = PE.allPEs(); e.hasMoreElements(); )
fork.start((PE) e.nextElement(), join);
join.waitFor();
- See Also:
- Serialized Form
|
Method Summary |
void |
start(PE pe)
Start the thread at the indicated PE. |
void |
start(PE pe,
Join join)
Start the thread at the indicated PE. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
RemoteThread
public RemoteThread()
start
public void start(PE pe)
throws java.lang.IllegalThreadStateException
- Start the thread at the indicated PE.
- Parameters:
pe - The PE where the thread should execute.
start
public void start(PE pe,
Join join)
- Start the thread at the indicated PE.
- Parameters:
pe - The PE where the thread should execute.join - notify Join when thread finishes.