KSE system scope vs non system scope threads
Christopher M. Sedore
cmsedore at maxwell.syr.edu
Sun Nov 30 06:43:09 PST 2003
From: Jeff Roberson [mailto:jroberson at chesapeake.net]
>> I ask this because I'm observing some behavior that I don't expect.
>> When running a threaded program with KSE and non-system-scope
>> threads, I see performance degradation in my network traffic when I'm
>> attempting to connect to remote hosts that are down. Libthr doesn't
>> see this degradation, and KSE with system-scope threads doesn't
>> perform as well as libthr, but is much closer.
>Can you describe the threaded application some? For certain types of
>tasks thr is likely to remain faster due to its simplicity. I'm mostly
>just curious to hear what your observations are.
Sure--I'm working on Usenet news transit software. Basically, inbound connections offering articles to the host and outbound connections offering the articles to other hosts. Inbound data rates are usually in the 6-10MB/sec range (much higher if you have a backlog of articles), outbound rates depend on the number of peers you have. In testing thus far, I've been pushing 30MB/sec with my current code. Thus far, libthr is fastest based on external benchmarks.
I think libthr may have a bug related to synchronization somewhere, though. After some random period, threads hang in sigwait (according to top). From what I've observed, everything is fine, then one thread hangs, then shortly thereafter the rest do (actually not all the rest, but any that content for mutexes do). Since I don't see these hangs with KSE or libc_r, I've blindly assumed that the problem is with libthr rather than my code.
More information about the freebsd-threads