Page 1 of 1

Written in C

Posted: Fri Jul 08, 2022 6:39 am
by answerhappygod
Written in C
Written In C 1
Written In C 1 (258.62 KiB) Viewed 36 times
Consider the following: • A program uses two threads to generate two numbers. ● V1 and V2 are used as shared variables to communicate between the two threads. • First thread T1: o Generates a number and stores it in V1. o Print The value in V2. Second thread T2 o Generates a number and stores it in V2. o Print The value in V1. • The program uses two Mutexs (M1 and M2) to synchronize access to shared variables. o M1 used to control access to V1 o M2 used to control access to V2 Program Details • Consider the provided details, write a simple program that causes a deadlock within the process using the detailed threads, Mutexes. Program Output • No output is needed for this program.