atom feed8 messages in org.freebsd.freebsd-currentRecent thread changes
FromSent OnAttachments
Daniel EischenOct 13, 2000 3:32 pm 
jd...@polstra.comOct 14, 2000 3:08 am 
Daniel EischenOct 14, 2000 6:33 am 
jd...@polstra.comOct 14, 2000 1:00 pm 
Daniel EischenOct 14, 2000 9:19 pm 
Gerhard SittigOct 15, 2000 3:38 am 
jd...@polstra.comOct 16, 2000 7:00 pm 
Daniel M. EischenOct 16, 2000 7:33 pm 
Subject:Recent thread changes
From:Daniel Eischen (eisc@vigrid.com)
Date:Oct 13, 2000 3:32:33 pm
List:org.freebsd.freebsd-current

I've just committed some changes to the threads library and would appreciate feedback from anyone running threaded applications. They include fixes that -stable could really use.

This commit also implements zero system call thread context switching in the threads library. Switching between threads is now much faster than before this change. At the end is a performance test for thread switches. The test program creates 10 threads that do nothing but pthread_yield(). Please realize that this is not an example of a typical application. Some applications may not see any noticeable improvement.

The range of valid priorities has also changed, perhaps requiring a library version bump. The range of valid priorities is not visible outside of the threads library. The only way it can be determined is through trial and error, so it _shouldn't_ be an issue.

BTW, _PTHREADS_INVARIANTS is the default for a while until I'm sure there aren't any major problems. The performance hit should be negligible. Edit src/lib/libc_r/Makefile to turn it off.

Before After

------------------------------------------------------------- Thread 0 iterations: 35400 Thread 0 iterations: 259131 Thread 1 iterations: 35400 Thread 1 iterations: 259131 Thread 2 iterations: 35399 Thread 2 iterations: 259131 Thread 3 iterations: 35399 Thread 3 iterations: 259130 Thread 4 iterations: 35399 Thread 4 iterations: 259130 Thread 5 iterations: 35399 Thread 5 iterations: 259130 Thread 6 iterations: 35399 Thread 6 iterations: 259130 Thread 7 iterations: 35399 Thread 7 iterations: 259130 Thread 8 iterations: 35399 Thread 8 iterations: 259130 Thread 9 iterations: 35399 Thread 9 iterations: 259130 Total iterations: 353992 Total iterations: 2591303

real 0m10.043s real 0m10.153s user 0m3.558s user 0m9.947s sys 0m6.445s sys 0m0.010s

To Unsubscribe: send mail to majo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message