Next: OPERATING SYSTEMS LABORATORY VI
Up: Ceng328 Operating Systems Laboratory
Previous: Assignment II; due to
Contents
- Write a program to calculate the factorial of a number. Your program should;
- create a thread,
- supply a function for the thread,
- output the result in the main (function/process/thread).
- Modify the code given in the fifth example such that;
- having 5 threads,
- each thread will increment the value of a global variable by one for 500 times.
- after each iteration the thread sleeps for a short while (sleep(2)),
- execute your program several times,
- compare the output with the fifth example's output.
- Now, increase the time for sleeping and the value for the loop such as:
- sleep(12),
- 5000000,
- apply the procedure above,
- what happens!!
Cem Ozdogan
2009-05-11