Whether the function running in the thread explicitly calls return or simply reaches its last instruction, this value is popped off the stack by the CPU into the program counter where execution continues. LWT's thread creation and elimination methods are very crude. This is remedied in the new version of LWT, to debut in March, 1999. A vivid example of this manifests itself in the execution of the count.c program. One might expect that the four threads' counter variables, shielded by a common mutex lock, would get equal amounts of CPU cycles resulting in all four threads' counter variables having similar values.
Actual test runs, however, can yield vastly different values for each thread's counter variable.
The lack of an appropriate priority mechanism which is responsible for this behavior will be rectified in the next LWT distribution. LWT is a prime example of the kind of productive work that gets accomplished on slow Tuesday nights. LWT may blossom into a rich, full-featured, multithreaded, mutliuser operating system. Particularly, I would like to redo the entire thread allocation-deallocation strategy. Anyone who knows anything about operating systems knows that my method heavily deviates from the usual, more effecient methods more commonly used.