I was studying about interrupts. So most architecture are interrupt driven, if everything is interrupt driven, how fast the processor can handle all of those. For example, while
In a normal linux system there is a nice value , and lower nice values have around typical 800ms quanta value and higher nice value have 5ms quanta.
Linux system uses heuristics to decide whether the process is interactive or not. You better read this note:
https://www.cs.columbia.edu/~smb/classes/s06-4118/l13.pdf
There are several data structures that regarding the scheduler, Such as linux keep track on number of interactive processes wait on IO bound , etc etc.
In windows more than preemptive multitasking , the application programs support the kernel through the GetMessage() API call[in the case of windows GUI programs].Where when you call GetMessage() , that process will schedule back when there is a message pending to be processed in it's system queue.
How quickly depends on multiple things:
That's a general answer to a general question.
EDIT: I've forgot to mention one more thing. There exist some odd CPUs in which certain instructions are repeatable (think of x86's rep movsb
) and interrupts can't start getting serviced until the repeated instruction fully finishes, which may take time equivalent to executing some 1000 or even more simple individual instructions. So, despite interrupts being enabled, there may be some CPU quirks not letting the ISRs to start running. One of such CPUs is TI's TMS320C54xx. With it you have to careful around FIR filter code. If the filter is long and is implemented as a repeated MAC instruction, it will introduce a latency in interrupt servicing.