tac0S
Template Affectional Command Operating System
Functions
threadtest.cc File Reference

Simple test case for the threads assignment. More...

#include "copyright.h"
#include "system.h"

Functions

void SimpleThread (int which)
 SimpleThread Loop 5 times, yielding the CPU to another ready thread each iteration. More...
 
void ThreadTest ()
 ThreadTest Set up a ping-pong between two threads, by forking a thread to call SimpleThread, and then calling SimpleThread ourselves.
 

Detailed Description

Simple test case for the threads assignment.

Author
Olivier Hureau, Hugo Feydel , Julien ALaimo
 Create two threads, and have them context switch
 back and forth between themselves by calling Thread::Yield, 
 to illustratethe inner workings of the thread system.

Copyright (c) 1992-1993 The Regents of the University of California. All rights reserved. See copyright.h for copyright notice and limitation of liability and disclaimer of warranty provisions.

Function Documentation

void SimpleThread ( int  which)

SimpleThread Loop 5 times, yielding the CPU to another ready thread each iteration.

Parameters
[in]whichis simply a number identifying the thread, for debugging purposes.