pthread switch (was Odd KSE panic)

Andrew Gallatin gallatin at cs.duke.edu
Tue Jul 6 13:30:28 PDT 2004


Daniel Eischen writes:
 > Note that he is holding the mutex while calling pthread_cond_signal().
 > If we enable preemption in pthread_cond_signal(), then I suspect it
 > would be even worse than without preemption.
 > 
 > I think the only place where it is sane to enable preemption is
 > on pthread_mutex_unlock().

That certainly makes sense to me.  But I don't want to see you
optimize the threads lib just for my app.   I can always put in an
#ifdef FreeBSD
pthread_yield()
#endif

But what I'm still wondering is where the ~3x slowdown (20usec linux
-> ~60usec, libthr) is coming from.  Is this a factor of the context
switch time and ithreads?

I need to move the driver to a fast interrupt and I need to test
SCHED_BSD as well.  I should probably cvs update to get jhb's
scheduling changes.

Drew



More information about the freebsd-threads mailing list