Process State Diagram question: Process A and Process B are submitted to be exec
ID: 3877822 • Letter: P
Question
Process State Diagram question:
Process A and Process B are submitted to be executed at the same time. Based off past history, Process A has been characterized as I/O bound and Process B has been characterized as CPU bound.
a) Assume Process B is executing in the CPU when Process A is loaded into memory. Describe a scenario where the system would elect to immediately preempt Process B and select Process A to execute (assume that there were other processes ready to run before Process A arrives). You may describe other characteristics to Process A and Process B to fit your scenario.
b) Assume that Process A and Process B were both loaded into memory at the same time• Describe a system scenario where by both processes complete execution at roughly the same time. Your solution should consider the Process State Diagram and describe which O state (and why) the processes spend the majority of their time.
Explanation / Answer
Answer:
a)
If the coming process A has a higher priority than the process B, which is currently in the critical section and executing will be preempted and process A will starts its execution.
The higher priority of the process depends on the kind of scheduling algorithm which is used for scheduling, the algorithm may be Shortest job first, Round Robin, Multilevel feedback queue or highest response ratio next.
In short, the algorithm must be a preemption algorithm.
b)
In order to complete both the processes roughly at the same time the characterization of the processes needs to be considered which says that
Process A has been characterized as I/O bound and Process B has been characterized as CPU bound.
So in the given case, first process A will complete its CPU burst then it will start executing the I/O operation, simultaneously process B will start executing CPU burst and when the operation is complete both the process will be finishing at the same time this is the best scenario to make it possible.
Please provide your valuable feedback.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.