|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnachos.machine.NachosThread
nachos.kernel.userprog.UserThread
public class UserThread
A UserThread is a NachosThread extended with the capability of executing user code. It is kept separate from AddrSpace to provide for the possibility of having multiple UserThreads running in a single AddrSpace.
Field Summary | |
---|---|
AddrSpace |
space
The context in which this thread will execute. |
private int[] |
userRegisters
User-level CPU register state. |
Fields inherited from class nachos.machine.NachosThread |
---|
BLOCKED, JUST_CREATED, READY, RUNNING, TERMINATED |
Constructor Summary | |
---|---|
UserThread(java.lang.String name,
java.lang.Runnable runObj,
AddrSpace addrSpace)
Initialize a new user thread. |
Method Summary | |
---|---|
void |
restoreState()
Restore the CPU state of a user program on a context switch. |
void |
saveState()
Save the CPU state of a user program on a context switch. |
Methods inherited from class nachos.machine.NachosThread |
---|
getName, getStatus, setRunnable, setStatus, switchTo |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final AddrSpace space
private int[] userRegisters
Constructor Detail |
---|
public UserThread(java.lang.String name, java.lang.Runnable runObj, AddrSpace addrSpace)
name
- An arbitrary name, useful for debugging.runObj
- Execution of the thread will begin with the run()
method of this object.addrSpace
- The context to be installed when this thread
is executing in user mode.Method Detail |
---|
public void saveState()
saveState
in class nachos.machine.NachosThread
public void restoreState()
restoreState
in class nachos.machine.NachosThread
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |