CPU Burst and I/O Burst - process

If a process that currently is being executed faces an I/O Burst, will the next available process gain the CPU burst or will the processor wait until the I/O Burst of the first process finishes to continue executing the first process.
Also does this get affected by whether an algorithm is preemptive or non-preemptive?
Thanks!

Related

I/o bound processors with Round robin algorithm

why does Round Robin algorithm doesn’t favor I/O bound processes and what changes could be made to fix this problem?
An I/O bound process will use few CPU time before waiting I/O to be complete. A round robin scheduler will put it at the end of the queue even if it used a few of its quantum. A CPU bound process will use the CPU for the whole quantum it has.

How CPU handles sleep function?

What will CPU do when a sleep(10) or equivalent statement is executed. How will it wait exactly for 60 seconds when CPU also does context switching a brings this process to wait state.
sleep function usually asks operating system to assign cpu to another process. Actually, there is a special process (usually named 'idle'), which gets the cpu if there are no other processes waiting for cpu. On intel processor, idle process executes special instruction (wait), which stops the processor (then, it does not execute more instructions). Whether is processor assigned to idle process or not, it still responds to hardware interrupts (special signals produced by other computer hardware in case the hardware would like to inform processor about some event). One of the interrupts source is a timer - it sends interrupt to cpu each 10ms or so (depends on concrete computer and operating system). As a response to the timer event, operating system may assign cpu back to the process, which executed the sleep - if the specified time elapsed.
As the operating system is able to measure time with precision of 1 timer tick, Your process will be ready in specified time +- 2 ticks. In case Your cpu is busy at the moment, Your process gets assigned the cpu with some additional delay.

Process states in operating system and resource utilization

What is a difference between sleep,wait and suspending a process in OS? Does any of these states consume resources or waste CPU cycles?
In all three cases, the process is not runnable, so it does not consume CPU. THe process is not returned to the runnable state until some event happens. The difference is what that event is:
Sleep: This can describe two different things. Either a process is runnable after a certain (fixed) period of time elapses, or the process is runnable after the device itself wakes up from a power saving mode.
Wait: process is runnable after something finishes. That something is usually an I/O operation (disk, network) completing.
Suspend: either the OS or another process takes the process out of the run state. This can overlap with "Sleeping" above.
Processes in all three states don't consume CPU time, but they do consume memory unless the process is entirely paged out. And processes in the wait state may be consuming I/O resources.

Process utilizes more than one core?

Having a dual-core CPU, I notice (on the Windows Task Manager) that some processes can take more than 50% CPU utilization. Knowing that each process can be executed in one cpu core at any given time, I'm expecting that it will utilize maximum 1/n of my n-core cpu. Note that my CPU is not HT capable. Do I misinterpret the value of CPU column?
If a process has multiple threads running, then you can use 100% of your CPU.
Each thread can use 100% of a single core, so you need N running threads in your process to use 100% of a N-core CPU.

Why I/O-bound processes are faster?

Typically the CPU runs for a while without stopping, then a system call is made to read from a file or write to a file. When the system call completes, the CPU computes again until it needs more data or has to write more data, and so on.
Some processes spend most of their time computing, while others spend most of their time waiting for I/O. The former are called compute-bound; the latter are called I/O-bound. Compute-bound processes typically have long CPU bursts and thus infrequent I/O waits, whereas I/O-bound processes have short CPU bursts and thus frequent I/O waits.
As CPU gets faster, processes tend to
get more I/O-bound.
Why and how?
Edited:
It's not a homework question. I was studying the book (Modern Operating Systems by Tanenbaum) and found this matter there. I didn't get the concept that's why I am asking here. Don't tag this question as a homework please.
With a faster CPU, the amount of time spent using the CPU will decrease (given the same code), but the amount of time spent doing I/O will stay the same (given the same I/O performance), so the percentage of time spent on I/O will increase, and I/O will become the bottleneck.
That does not mean that "I/O bound processes are faster".
As CPU gets faster, processes tend to get more I/O-bound.
What it's trying to say is:
As CPU gets faster, processes tend to not increase in speed in proportion to CPU speed because they get more I/O-bound.
Which means that I/O bound processes are slower than non-I/O bound processes, not faster.
Why is this the case? Well, when only CPU speed increases all the rest of your system haven't increased in speed. Your hard disk is still the same speed, your network card is still the same speed, even your RAM is still the same speed*. So as the CPU increases in speed, the limiting factor to your program becomes less and less the CPU speed but more about how slow your I/O is. In other words, programs naturally shift to being more and more I/O bound. In other words: ..as CPU gets faster, processes tend to get more I/O-bound.
*note: Historically everything else also improved in speed along with the CPU, just not as much. For example CPUs went from 4MHz to 2GHz, a 500x speed increase whereas hard disk speed went from around 1MB/s to 70MB/s, a lame 70x increase.