CS 0449 – pthreads Lab

 

Make a program with two threads, each that displays a different character on the screen, like ‘.’ and ‘#’ in an infinite loop.  Run the program, and eventually stop it with CTRL+C. The time between thread switches is called a quantum.  Does the quantum seem long or short?

 

 

 

 

 

 

What happens if you insert a pthread_yield() into each loop?

 

 

 

 

 

 

Note: Remember to compile your program with the -pthread option