UNIX semiportable threads

This is a uselevel multithreading system that supports the Fork and Yield opperation. It was designed with different specs than the CSE 451 minithreads project. It uses the UNIX system calls setjmp and longjmp to do context switching. Writing threads in this manner is very much a hack as we still really only have one stack, we just devide it up into little pieces.

This is not a preemptive threads system, however adding preemption can be done in the same way as the CSE 451 threads package. You can use the signal and kill system calls to register an interrupt handler and send an interrupt respectively. The setitimer system call can be used to set a timer to send your process an interrupt at any given interval.

Here are the source files:

This threads package has been debugged on Linux it is not guarenteed to work on any other platform. However, it should work or be easily modified to work on any UNIX platform. It does not rely on any architecture dependent assembly.