Question
Write a C program where processes synchronize via polling such that a process A prints out the strings of two other separate writing processes (B
Write a C program where processes synchronize via polling such that a process A prints out the strings of two other separate writing processes (B first and then C second) from shared memory. process A needs to 'wait' by polling until B and C finish writing their strings to memory.
Here is the sequence of events that needs to be implemented: 1. Process A writes to position 1 in memory and then waits until B and C completes 2. Process B writes the string "shared" into memory then signals A & C that it is complete by writing into memory position 1 (note B should wait to write into position 1 until after process A writes into position 1 in memory) 3. Process C writes the string "memory" into memory and then signals A that it is complete by writing into memory position 1 (note C should wait until process B writes into position 1 in memory)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started