CS 475 Assignment 1: Threads and Processes Experiments, Assignments of Computer Science

The instructions for assignment 1 of the cs 475: concurrent & distributed software systems course at george mason university. The assignment includes three experiments comparing thread and process creation times, processes vs threads behavior, and the lost update problem in shared variables. Students are required to compile and execute the provided programs and analyze the results.

Typology: Assignments

Pre 2010

Uploaded on 02/12/2009

koofers-user-emh
koofers-user-emh 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
GEORGE MASON UNIVERSITY
DEPARTMENT OF COMPUTER SCIENCE
CS 475 Concurrent & Distributed Software Systems
Spring 2003
Assignment 1: DUE Feb 10
Experiment 1. Thread and Process Creation Study the programs thr_create.c and fork.c. Com-
pile and execute the programs. These programs measure the average time to create a thread using
thr_create and to create a process using fork. What do you conclude from this experiment?
Briefly describe the reasons for the difference in timings.
Experiment 2. Processes vs Threads Study the two programs thr_shared.c and proc_shared.c.
Compile and execute the programs. These programs are identical except that one uses threads and
the other uses processes. What do you conclude from this experiment? Explain the reason for the
difference in behavior.
Experiment 3: The Lost Update Problem Study the program shared_data.c. Compile and execute
it. The main thread and the child thread are both updating (i.e., modifying) the shared variable
shared_number. Is the program behaving “correctly”? What do you conclude from this experi-
ment?
NOTES 1. All these programs are available from the web page with URL
http://cs.gmu.edu/˜setia/cs475/assignments/assign1. These programs have
been tested on Solaris and Linux platforms.
2. Read the README file in the directory for directions on how to compile and link the programs
3. The Useful Links page on the class home page has links to web sites where documentation on
Pthreads (including the Solaris Multithreaded Programming Guide) is available.
1

Partial preview of the text

Download CS 475 Assignment 1: Threads and Processes Experiments and more Assignments Computer Science in PDF only on Docsity!

GEORGE MASON UNIVERSITY

DEPARTMENT OF COMPUTER SCIENCE

CS 475 – Concurrent & Distributed Software Systems

Spring 2003

Assignment 1: DUE Feb 10

Experiment 1. Thread and Process Creation Study the programs thr_create.c and fork.c. Com- pile and execute the programs. These programs measure the average time to create a thread using thr_create and to create a process using fork. What do you conclude from this experiment? Briefly describe the reasons for the difference in timings.

Experiment 2. Processes vs Threads Study the two programs thr_shared.c and proc_shared.c. Compile and execute the programs. These programs are identical except that one uses threads and the other uses processes. What do you conclude from this experiment? Explain the reason for the difference in behavior.

Experiment 3: The Lost Update Problem Study the program shared_data.c. Compile and execute it. The main thread and the child thread are both updating (i.e., modifying) the shared variable shared_number. Is the program behaving “correctly”? What do you conclude from this experi- ment?

NOTES 1. All these programs are available from the web page with URL http://cs.gmu.edu/˜setia/cs475/assignments/assign1. These programs have been tested on Solaris and Linux platforms.

  1. Read the README file in the directory for directions on how to compile and link the programs
  2. The Useful Links page on the class home page has links to web sites where documentation on Pthreads (including the Solaris Multithreaded Programming Guide) is available.