class Thread

A single thread of execution

Inheritance:


Public Methods

[more] Thread( Computer* newComputer, Process* newParent, TIME newMemAccessRate, TIME localSynchRate, TIME globalSynchRate, const string newName="Thread", const ID newID=0)
Default constructor
[more] ~Thread()
Destructor
[more]MEMAMT allocateSafeLocalMemory(MEMAMT allocated = 0.0)
[more]bool allocateMemory()
[more]void deallocateMemory()
[more]ProcessEvent getNextEvent()
Returns the next event this thread will generate
[more]ID getNextCommunication()
[more]TIME getCPUReqTime(void)
[more]bool getNextAccess(void)
Gets the next page of memory this thread will access
[more]TIME nextCPUReqOk(void)
a signal to the thread object
[more]void pageIn(void)
Simulates bringing in one page of data into main memory
[more]void finishGlobalSynch()
[more]void overallocation(MEMAMT netRAM, MEMAMT disk)
[more]void suspend()
[more]bool isEventLengthSet(void) const
[more]TIME initEventInfo(TIME totalTime, ProcessEvent event)
Initializes event information (e.g. elapsed time is set to 0)
[more]void resetEventInfo(void)
[more]void updateEventInfo(void)
Updates event information
[more]void recalculateEvent(void)
signals the thread that no more work should be done and the current event should be repeated
[more]void restart(void)
restarts the current event
[more]void quickRestart(void)
[more]void useCPUTime(TIME amount)
Subtracts the amount passed from the CPU time remaining
[more]void addNeighbor(ID computer)
[more]Process* getParent(void) const
[more]ProcessEvent getEvent(void) const
[more]TIME getEventStart(void) const
[more]TIME getEventTime(void) const
[more]TIME getEventElapsed(void) const
[more]TIME getEventRemaining(void) const
[more]ID getNextCommId(void) const
[more]TIME getCPUTimeLeft(void) const
[more]unsigned long getTotalPageFaults(void) const
[more]Computer* getHost(void)
[more]TIME getSuspendedTime(void) const
[more]void setParent(Process* newProcess)
Sets the process this thread belongs to
[more]void setEventTime(const TIME amount)
Sets the amount of time this event will take to execute
[more]void setMemoryAccessRate(const TIME amount)
Sets how often a memory access will occur.
[more]void setPNRClient(PNRClient* client)


Inherited from SimObj:

Public Methods

ostring getName(void) const
oID getID(void) const
ovoid setName(const string newName)
ovoid setID(const ID newID)
ovirtual void clear(void)
ovirtual string toString(void) const
ovirtual bool activate(void)


Documentation

A component of a process (or job).
o Thread( Computer* newComputer, Process* newParent, TIME newMemAccessRate, TIME localSynchRate, TIME globalSynchRate, const string newName="Thread", const ID newID=0)

o ~Thread()

oMEMAMT allocateSafeLocalMemory(MEMAMT allocated = 0.0)

obool allocateMemory()

ovoid deallocateMemory()

oProcessEvent getNextEvent()
A side effect of this function is that the event after the event being returned may be generated

oID getNextCommunication()

oTIME getCPUReqTime(void)

obool getNextAccess(void)
This algorithm was lifted from one of Feitelson's papers.

oTIME nextCPUReqOk(void)
This signal states that the CPU may be requested for any length of time and no page faults will result.

ovoid pageIn(void)
Note that the data could be coming from disk or network RAM - the thread doesn't really care.

ovoid finishGlobalSynch()

ovoid overallocation(MEMAMT netRAM, MEMAMT disk)

ovoid suspend()

obool isEventLengthSet(void) const
Returns:
whether the length of the current event has been calculated or not.

oTIME initEventInfo(TIME totalTime, ProcessEvent event)

ovoid resetEventInfo(void)

ovoid updateEventInfo(void)
Updates elapsed time and remaining time (among others) based on current time and when the event was last updated.

ovoid recalculateEvent(void)

ovoid restart(void)

ovoid quickRestart(void)

ovoid useCPUTime(TIME amount)

ovoid addNeighbor(ID computer)

oProcess* getParent(void) const
Returns:
the parent process

oProcessEvent getEvent(void) const
Returns:
the currently executing (or suspended) event

oTIME getEventStart(void) const
Start time is really the last update time. Start time could either be the real start time, or it could be when updateEventInfo() was last called.
Returns:
when the event was "started"

oTIME getEventTime(void) const
Returns:
the total amount of (service) time the event will take

oTIME getEventElapsed(void) const
Returns:
the amount of (service) time the event has gotten so far

oTIME getEventRemaining(void) const
Returns:
the amount of (service) time the event must still receive in order to complete

oID getNextCommId(void) const
Returns:
the next computer we will communicate with

oTIME getCPUTimeLeft(void) const
Returns:
the amount of CPU time that must still be completed before this thread will finish

ounsigned long getTotalPageFaults(void) const

oComputer* getHost(void)

oTIME getSuspendedTime(void) const

ovoid setParent(Process* newProcess)

ovoid setEventTime(const TIME amount)

ovoid setMemoryAccessRate(const TIME amount)

ovoid setPNRClient(PNRClient* client)


This class has no child classes.
Author:
John Oleszkiewicz

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.