On Friday, March 22, 2013 4:10:16 pm vasanth rao naik sabavat wrote: > Hi Adrian, > > Just to clarify, is the kernel pre-emption involuntary? > > Let say I have a kernel thread processing a huge list of entries, would > this thread get involuntarily context switched out because of kernel > preemption? > > What is the time slice after which a kernel thread can involuntarily > context switched out? > > Could you please point to the file in the source code which handles the > kernel pre-emption.
In-kernel preemption is driven by interrupts, not time slices. If an interrupt arrives that awakens a higher priority thread (e.g. an interrupt thread), or if your thread awakens a thread that has higher priority (e.g. due to wakeup() or cv_signal()), then your thread will be preempted. In general time-based preemptions are only done for user threads. -- John Baldwin _______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"