Problem 3 A precedence graph is a directed, acyclic graph. Nodes represent tasks
ID: 3593862 • Letter: P
Question
Problem 3 A precedence graph is a directed, acyclic graph. Nodes represent tasks, and arcs indicate the order in which tasks are to be accomplished. In particular, a task can execute as soon as its predecessors have been completed. Assume that the tasks are processes and that each process has the following outline: Process T Wait for predecessors, if any Body of the task; Signal successors, if any; Using semaphores, show how to synchronize five processes whose permissible execution order is specified by the following precedence graph: I1 113 T3 Do not impose constraints that are not specified in the graph. For example, T2 and T3 can execute concurrently after T1 completes. Answer:Explanation / Answer
Process T1{
No wait, as it is the first task to execute;
Execute T1;
Signal T2 and T3 to execute;
}
Process T2{
Wait for process T1 to complete its execution
Execute T2;
Signal T4 for execution;
}
Process T3{
Wait for process T1 to complete its execution
Execute T3;
Signal T5 to execute;
}
Process T4{
Wait for process T2 to complete its execution
Execute T4;
Signal T5 to execute;
}
Process T5{
Wait for process T3 and T4 to complete their execution
Execute T5;
No signal, because its last task;
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.