Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

There are two programs in execution (process A and process B) on a single CPU system. The following figure represents the machine state right after

image text in transcribed

There are two programs in execution (process A and process B) on a single CPU system. The following figure represents the machine state right after the execution of the statement "me = getpid ()" on Process A, and the CPU is about to execute a user-space subroutine yield (B). Explain and draw what machine state changes will be made right after the call instruction to the subroutine yield (B) on Process A. Note that you are not asked to simulate the entire execution of yield) routine, but you are simply asked to simulate just a call instruction to subroutine yield (B). You must show changes in PC, SP, and user stack area for Process A Process A Process B stack stack return address- Pointer to previous AR p: A magic : 1 PC SP me: A me: B main ) main ) text! me-getpid) yield (B) yield (A); me getpid ( ) yield (A) yield (A); Shared mamory A. Context yield (process *p) yield (process *p) PC int magic 0; saveContext (me) if (magic1) int magic 0; saveContext (me) SP - ->if (magic return: 1) "" return: B. Context else else PC-- magic 1; restoreContext (p) magic-l: restoreContext (p) SP There are two programs in execution (process A and process B) on a single CPU system. The following figure represents the machine state right after the execution of the statement "me = getpid ()" on Process A, and the CPU is about to execute a user-space subroutine yield (B). Explain and draw what machine state changes will be made right after the call instruction to the subroutine yield (B) on Process A. Note that you are not asked to simulate the entire execution of yield) routine, but you are simply asked to simulate just a call instruction to subroutine yield (B). You must show changes in PC, SP, and user stack area for Process A Process A Process B stack stack return address- Pointer to previous AR p: A magic : 1 PC SP me: A me: B main ) main ) text! me-getpid) yield (B) yield (A); me getpid ( ) yield (A) yield (A); Shared mamory A. Context yield (process *p) yield (process *p) PC int magic 0; saveContext (me) if (magic1) int magic 0; saveContext (me) SP - ->if (magic return: 1) "" return: B. Context else else PC-- magic 1; restoreContext (p) magic-l: restoreContext (p) SP

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions

Question

Describe the effect of automation on the process costing system.

Answered: 1 week ago