I was a little bit disapointed when I mentioned that
Python 2.4 uses libpthread library on FreeBSD 5 but
avoids using system scope threads. I tried digging
google to clarify why it is so and found out that it
was because one of threading regression tests
(test_threaded_import) failed on FreeBSD 5 (https://
sourceforge.net/tracker/?
func=detail&atid=305470&aid=902444&group_id=5470). I
compiled Python on my FreeBSD 5.4-RELEASE-p8 and ran
all the regression tests (I executed regrtest.py) and
saw no errors at all. I tried test_threaded_import and
the test was successful.
I don't see any reason why to avoid using system scope
threads specially on FreeBSD. I know that using
userland scope threads is quite faster because there is
no need for kernel activities in context switching. But
as far as I know most of servers (where speed is
important) are SMP boxes. Userland scope threads don't
use capabilities of multiple CPU's, so it should be
reasonable to use system scope threads.
To make it even better it could be good idea to make
use of configuration parameter which determines which
kind of threads has to be used. Since I'm not autoconf
guru I made a patch which just removes checking against
FreeBSD in thread_pthread.h
Regards,
Valts.
mailto:valdiic@one.lv
|