|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nachos.threads.KThread nachos.userprog.UThread
public class UThread
A UThread is KThread that can execute user program code inside a user process, in addition to Nachos kernel code.
Field Summary | |
---|---|
UserProcess |
process
The process to which this thread belongs. |
int[] |
userRegisters
Storage for the user register set. |
Fields inherited from class nachos.threads.KThread |
---|
schedulingState |
Constructor Summary | |
---|---|
UThread(UserProcess process)
Allocate a new UThread. |
Method Summary | |
---|---|
protected void |
restoreState()
Restore state before receiving the processor again. |
protected void |
saveState()
Save state before giving up the processor to another thread. |
Methods inherited from class nachos.threads.KThread |
---|
compareTo, currentThread, finish, fork, getName, join, ready, selfTest, setName, setTarget, sleep, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int[] userRegisters
A thread capable of running user code actually has two sets of CPU registers: one for its state while executing user code, and one for its state while executing kernel code. While this thread is not running, its user state is stored here.
public UserProcess process
Constructor Detail |
---|
public UThread(UserProcess process)
Method Detail |
---|
protected void saveState()
saveState
in class KThread
protected void restoreState()
restoreState
in class KThread
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |