关键词 > CST357/457

CST 357/457 Homework #5

发布时间:2022-04-13

Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

CST 357/457

Homework #5

Undergraduates & Graduate Students:

For this assignment, you will be writing four separate C programs. You will create a folder which contains all programs and documentation and then zip the folder for submission to blackboard.  Please be sure to document your programs appropriately. You must rename the file using your last name followed by your first name followed by a dash followed by the assignment name (For instance, this is homework5, so I’d turn it in as RuthMichael-Homework5.zip)

For this  homework, well create single-threaded and multi-threaded applications which recursively determines the frequency of the letters (A-Z) while ignoring case for a given directory.  Well create a few versions to consider the costs and benefits of using threads for the given operations.  Youll need to add a timer to each of the following programs (Make sure you are timing the entire operation).

1.    (10%) For the first system, do the given work without threads.  You should use the file you are given to do this part of the assignment (You’re simply given credit for adding the timer to this file).

2.    (30%) For the second system, modify the program from 1 which creates a thread for each directory (don’t forget to use locks, joins, and your timer appropriately)

3.    (30%) For the third system, modify the program from 1 in which threads are based on one per alphabet letter (no locks are necessary, but you’ll still need a timer and joins)

4.    (30%) Compare the results of the timing across all five systems. You should run each program like 10-

20 times in order to more accurately compare the results.

Graduate Students Only (or UG for extra credit + 50)

Alternative Systems:

1.    (20%) For the fourth system, modify the program from 1 which creates a thread for each file (don’t forget to use locks, joins, and your timer appropriately)

2.    (20%) For the fifth system, modify the program from 1 which creates a thread for each file and directory (don’t forget to use locks, joins, and your timer appropriately)

3.    (5%) For the sixth system, modify the program from homework #4 part two (add timers).

4.    (5%) Add these systems into the discussion in question #4.