Process scheduling is based on the time-sharing technique that relies on the timer interrupts.
A user space process is preempted when it's time slice is expires. The scheduler is being called also before returning to user space from a system call as you have mentioned - although it is not the only case.
you may want to check 'Understanding The Linux Kernel' for further details:
http://www.oreilly.com/catalog/linuxkernel/
Eliad.
On 1/27/06, Ashok Sharma <aks6d@xxxxxxxxxxx> wrote:
User preemption can occur when (i) returning to user
space from a system call (ii) when returning to user
space from an interrupt handler.
My doubt is that one of these conditions may occur
Only after the time slice of a process is over. Worse
still can a user be executing without making a system
call or interrupt occurring. In this case user will
not preempt even long after the time slice is over as
preemption depends on conditions (i) and (ii) given
above. Or am I missing a point. Please explain.
Best
Ashok
___________________________________________________________
Win a BlackBerry device from O2 with Yahoo!. Enter now. http://www.yahoo.co.uk/blackberry
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/