CSCI 3232 Systems Software Assignment 6 Note: You need to be able to figure out whether there are race conditions in a program and tell the possible outputs without actually running the code. You...

in c


CSCI 3232 Systems Software Assignment 6 Note: You need to be able to figure out whether there are race conditions in a program and tell the possible outputs without actually running the code. You should also be able to apply mutex and semaphore techniques to synchronize your programs should any race conditions arise. 1. (25 pts) Read given code RaceOrNot1.c and write all possible outputs of the program. Assume there will be no thread creation or joining failures or mutex or semaphore failures. If you believe there is only one possible output, you just need to write that output. Pay attention to the note above. 2. (25 pts) Read given code RaceOrNot2.c and write all possible outputs of the program. Assume there will be no thread creation or joining failures or mutex or semaphore failures. If you believe there is only one possible output, you just need to write that output. Pay attention to the note above. 3. (50 pts) From previous homework you are already familiar with the math function f defined on positive integers as f(x)=(3x+1)/2 if x is odd and f(x)=x/2 if x is even. Given any integer var, iteratively applying this function f allows you to produce a list of integers starting from var and ending with 1. For example, when var is 6, this list of integers is 6,3,5,8,4,2,1, which has a length of 7 because this list contains 7 integers (call this list the Collatz list for 6). Write a C program A6p3.c that accepts three command line arguments a, b and n which are assumed to be positive integers with a
the integer is 8. Checklist of the two files to be submitted: A6p3.c (to Gradescope) Text solution file A6p1p2.txt for problems 1,2 (to Dropbox)
Apr 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here