Lab4 - Lab4: Introduction to Threads Goal In this lab you...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Lab4: Introduction to Threads Goal In this lab you will be introduced to thread programming and to the need for mutual- exclusion when more than one thread is used. Part 1: Thread Creation 1. Copy the file lab4-src.tar.gz to your directory, uncompress it and untar it. gunzip lab4-src.tar.gz tar -xvf lab4-src.tar 2. Examine the contents of the files thr1.cc. 3. Change directoy to lab4-src and build the executables: cd lab4-src make Run the program thr1 several times to verify that the output is compatible with your expectations. 4. Now modify the thr1.cc program to have two more threads: one printing "D" and the other one printing "E". 5. Examine the program thr2.cc and the run it. Explain why the thr2 program is having this output even though two threads are created. Add a README file with a textual description of the output you obtained in step 3 and the explanation of step 5, also you will turnin your modified thr1.cc from step 4, Part 2. Mutual Exclusion 1. Examine the file count.cc
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/30/2012 for the course CS 252 taught by Professor Gustavorodriguez during the Fall '11 term at Purdue University-West Lafayette.

Page1 / 2

Lab4 - Lab4: Introduction to Threads Goal In this lab you...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online