Commit 49f2ec7d authored by Son Pham's avatar Son Pham

Merge branch 'master' of

parents d0547dd5 4ea612f6
......@@ -10,7 +10,38 @@ compiles src/adt-test.c and places the executable in directory bin/.
Score: 20 / 20
Comment: Appears to be working, but in the future it would be helpful to show a test case where you insert more than the size of the list, or simply printing the entire array after each command so we can see what's going on
perlab2: 1. Describe succintly the difference between mutex and semaphore.
2. Write a couple of sentences to describe each of the six calls
1. pthread_mutex_init
2. pthread_mutex_lock
3. pthread_mutex_unlock
4. sem_init(3)
5. sem_wait(3)
6. sem_post(3)
Score: 10 / 10
problem 2: flesh out the functions that model producer and consumer threads. Work with
the code to verify that the numbers being generated to pass into usleep do
look random – you will have to restructure calls to rand_r so that you can
print the values to standard out for inspection.
Score: 10 / 10
problem 3: Create a file called answers.txt in which you explain why rand_r is thread
Score: 0 / 10
Comment: answers.txt file not found
problem 4: Circular_list_insert and circular_list_remove functions have the required
Score: 15 / 30
Comment: -15: insert and remove functions do not have the required synchronization (mutex & sem)
problem 5: Finally, flesh out the main() function in prodcons.c to bring everything
together. Your main() will read three command line parameters, all integers,
provided as in the example below. If the user tries to invoke your program
without these three parameters, your program should: (a) display a help
message indicating the correct usage (hint: use the structure in the example
below) and (b) exit with (-1) termination status.
Score: 20 / 20
TOTAL 20.0 / 100
TOTAL 75.0 / 100
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment