~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
As far as I can make out, quantum is the total time that a process has to spend in order to complete
No, read the article again.Each thread has a quantum, which is effectively how long it is allowed to keep hold of the CPU
[...]
a quantum is usually a small number of clock ticks, depending on the OS
[...]
a clock tick is typically 10-15 ms under Windows; under Linux, it is 1ms
BTW, yield is not about processes; it's about threads.
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
I think that processes as well as threads are given time slices
Yes, but "Thread.yield", as mentioned in your original post specifically refers to threads.But still what is the difference between time slice and quantum ? I am not able to understand. They are synonymous in most literature (even in Wikipedia)
The terms are indeed used synonymously all over the internet. There was one message on some micro-kernel mailing list which jots down the difference (which again isn't very clear):
In short, the timeslice determines for how long a thread can
continuously occupy a CPU before being preempted, the quantum limits the
total time the thread may spend on the CPUs accumulated over all
occasions the thread was scheduled.
Maybe you should mail Neil (the original author of the article) or PM neilcoffey (the author of the article) on Daniweb for clarifications.
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734