|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nachos.network.PostOffice
public class PostOffice
A collection of message queues, one for each local port. A PostOffice interacts directly with the network hardware. Because of the network hardware, we are guaranteed that messages will never be corrupted, but they might get lost.
The post office uses a "postal worker" thread to wait for messages to arrive from the network and to place them in the appropriate queues. This cannot be done in the receive interrupt handler because each queue (implemented with a SynchList) is protected by a lock.
Constructor Summary | |
---|---|
PostOffice()
Allocate a new post office, using an array of SynchLists. |
Method Summary | |
---|---|
MailMessage |
receive(int port)
Retrieve a message on the specified port, waiting if necessary. |
void |
send(MailMessage mail)
Send a message to a mailbox on a remote machine. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PostOffice()
Method Detail |
---|
public MailMessage receive(int port)
port
- the port on which to wait for a message.
public void send(MailMessage mail)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |