程序案例-EEE6207

EEE6207: OS Question
Sketch the design of a simple thread library to co-operatively run threads wholly within a user’s
program. The requirement is to allow a user to run any number of concurent threads of execution
(subject to available system resources) within a single process they have created. Your solution
should not use existing thread libraries, such as pthreads, or employ any kernel threads although
you can assume access to the usual collection of standard UNIX/Linux timing and other functions.
The design should be sketched out in sufficient detail to allow a competent programmer to
implement it, and should be capable of being programmed with basic C. There is no requirement for
you to implement actual code; you may, however, choose to illustrate your design with outlines of C
structures or similar. There is no requirement for your thread library to include synchronisation
primitives, or to interface with external events. You should, however, clearly explain the mechanism
(or mechanisms) by which your proposed system switches between different threads. [80%]
Outline the possibility of extending your cooperative (or non-preemptive library) to a fully
preemptive library. [20%]