Subj : Re: JOB: Sandbridge Technologies, White Plains, NY To : comp.programming.threads From : Marcin 'Qrczak' Kowalczyk Date : Fri Jul 15 2005 11:49 pm "David Schwartz" writes: > Fundamental rule: If there's any way you can allow a thread to keep > running until it uses up its timeslice, do that. Only preempt a thread if > that thread cannot make forward progress or you have a ready-to-run thread > at a higher static priority or *much* higher dynamic priority. Is there a way to implement mutexes and condvars on Linux/NPTL such that the signalling thread is not preempted? It doesn't have to be portable, the only requirement is that it's possible to check whether it works. In the runtime of my language I often signal before pthread_cond_wait and thus I can't move signalling after unlocking, and the preemption is totally pointless - three context switches instead of one. -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/ .