|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectPE
public class PE
This class represents a physical processor involved in the time warp simulation engine. A PE could have multiple LPs running on it.
Field Summary | |
---|---|
(package private) java.util.concurrent.PriorityBlockingQueue<Message> |
cancelQ
The queue that holds messages that have been cancelled. |
(package private) Flag |
flag
Flag for end of sim |
(package private) java.util.concurrent.PriorityBlockingQueue<Message> |
freeQ
The queue that holds the events whose memeory is free to reclaim. |
(package private) GNSInterface |
gns
The global name server |
(package private) int |
GVT
The most recent GVT |
(package private) LocalNameServer |
localNameServer
The LocalNameServer in charge of routing messages. |
(package private) java.util.Vector<LPConfigInfo> |
lpConfigInfo
The LP configuration information |
(package private) int |
myID
The id of this PE. |
(package private) java.lang.String |
myIP
The ip of the machine where the PE is running |
(package private) java.lang.String |
myMachineName
The name of the machine where the PE is running |
(package private) Peer[] |
peers
an array of Peer objects serving as the handles of the remote methods |
(package private) SchedulingLoop |
schedulingLoop
The scheduler that schedules events for this PE. |
(package private) java.util.concurrent.PriorityBlockingQueue<Message> |
sendQ
The queue that holds the outgoing messages. |
(package private) java.lang.String |
serverName
the name of the GNS server |
(package private) int |
sleepTime
Sleep time |
Constructor Summary | |
---|---|
PE(java.lang.String sv,
int numPEs)
|
Method Summary | |
---|---|
void |
addLP(LogicalProcess lp)
Adds a LP into LPs. |
(package private) int |
computeLocalMin()
Computes the local minimum timestamp |
(package private) void |
connectToGNS()
Connects this PE to the GNS server, receives LP information and create LPs accordingly. |
(package private) void |
createLP(LPConfigInfo lpinfo)
Create LPs according to the LP configuration information obtained from the GNS(Global Name Server). |
(package private) void |
doSleep(int sleeptime)
Puts the current thread to sleep for sleeptime miliseconds. |
void |
doYield()
Yields the current thread. |
(package private) void |
finalizeLPs()
Finalizes LPs by invoking finalizeLP method provided by subclasses of LogicalProcess. |
(package private) void |
finalizePE()
Finalizes the PE by checking and setting the end-of-sim flag. |
int |
getID()
Returns the id of the PE. |
(package private) LogicalProcess |
getLPByID(int lpid)
Gets the LP by its id. |
(package private) void |
initLPs()
Initialize LPs by invoking initializeLP method provided by subclasses of LogicalProcess. |
static void |
main(java.lang.String[] args)
The main function for this PE |
(package private) void |
processCanQ()
Places AntiMessages in CanQ. |
(package private) void |
processEvents()
Processes events. |
(package private) void |
processQs()
Processes the queues. |
(package private) void |
rmiSendMessages()
Sends messages by invoking the remote method receiveMsg(Message msg) on the receiver machine. |
void |
run()
Runs the PE(processing events). |
(package private) void |
setEOSflag()
Sets the end of sim flag so the PE will stop. |
void |
setID(int theID)
Sets the id for the PE (dummy method). |
void |
setSleepTime(int st)
Sets the sleep time for this thread; sleep time is specified by the user at the command line. |
(package private) void |
updateGVT(int newGVT)
Updates GVT and does fossil collection. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
Peer[] peers
int myID
java.lang.String myMachineName
java.lang.String myIP
java.util.Vector<LPConfigInfo> lpConfigInfo
int GVT
int sleepTime
GNSInterface gns
LocalNameServer localNameServer
java.util.concurrent.PriorityBlockingQueue<Message> cancelQ
java.util.concurrent.PriorityBlockingQueue<Message> sendQ
java.util.concurrent.PriorityBlockingQueue<Message> freeQ
SchedulingLoop schedulingLoop
Flag flag
java.lang.String serverName
Constructor Detail |
---|
public PE(java.lang.String sv, int numPEs)
Method Detail |
---|
void setEOSflag()
void connectToGNS() throws java.rmi.RemoteException
java.rmi.RemoteException
public void run()
run
in interface java.lang.Runnable
void finalizePE()
void rmiSendMessages()
void processEvents()
public static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException
public void setSleepTime(int st)
public void doYield()
void doSleep(int sleeptime)
sleeptime
- int the length for the sleep in miliseconds.int computeLocalMin()
local minimum timestamp = the minumum timestamp among
void updateGVT(int newGVT)
newGVT
- int the new GVT broadcast by the controllervoid processQs()
void processCanQ()
void createLP(LPConfigInfo lpinfo)
lpinfo
- LPConfigInfo object containing the lp configuration informationLogicalProcess getLPByID(int lpid)
lpid
- int the LP id.void initLPs()
void finalizeLPs()
public void addLP(LogicalProcess lp)
public int getID()
public void setID(int theID)
theID
- int representing the value that the PE's id will be set to.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |