502 views
0 votes
0 votes

Blocked

A process transitions to a blocked state when it cannot carry on without an external change in state or event occurring. For example, a process may block on a call to an I/O device such as a printer, if the printer is not available.

Source : https://en.m.wikipedia.org/wiki/Process_state

My questions is Let say process p is in running state .Now it wants printer access and if printer is available so process should start transfering data to printer for printing.So now while doing in this in which state process will be

 

1 Answer

Best answer
0 votes
0 votes

The process will be in blocked state. The term "blocked" doesn't mean unavailability of resources - it just means that the job is blocked from using the CPU.

Whenever a job initiates an I/O request, it won't be using the CPU for that time. It's the job of the scheduler then to find another process which can run during the time when the former job's I/O is being serviced. When the I/O is finished, the job then signals an interrupt to the operating system and the scheduler decides what has to be done next.

EDIT: Doesn't the hardware require usage of the CPU?

No, it doesn't. Whenever the CPU issues an I/O instruction such as reading from a hard drive, the request is processed by the hardware/device controller, which is a specialised chip present on the hardware. 

"Originally these were simple chips that performed specific operations for the CPU, but modern hardware controllers are basically their own microprocessors with firmware and everything, so they are capable of very complex operations without the main CPU's help. The controller is able to read and write directly to and from system RAM using what is called a Direct Memory Access (DMA) controller, a special chip that transfers data from the hardware controller to main RAM without the CPU needing to do anything. Thus, the CPU does not need to micromanage all tasks involved with I/O. At one time this used to be the case, but these tricks (interrupts, DMA, special controllers) were invented in order to improve CPU performance and make things a lot more efficient."

Source: https://stackoverflow.com/questions/13596997/why-is-the-cpu-not-needed-to-service-i-o-requests

selected by

Related questions

295
views
0 answers
0 votes
miguelcruz100 asked Dec 13, 2023
295 views
can someone create the gantt chart for these two questions.from i understood, we can't create a gantt chart for part a and b since we dont ... illustrate the scheduling of these two processes using earliest deadline first (EDF) scheduling
325
views
1 answers
1 votes
FaisalSyed asked Mar 16, 2023
325 views
Does Waiting Time and Response TIme remains the same in Preemptive Scheduling Algorithm???