PPT Slide
Extend SOS to support threads through three new calls:
- int CreateThread(char *startAddr, char *startStack) - start a new thread; code begins at startAddr and the stack it will use is at startStack. Call returns a Thread ID (tid).
- int ExitThread(int returnCode) - similar to a process Exit() call, except the last thread of a process, where it is exactly the process Exit() call.
- int WaitThread(int tid) - block the calling thread until the thread specified by tid calls ExitThread().
Stack management is the responsibility of the thread creator (except for the first thread).