Re: Kernel Threads: Dr. Russinovich's response

Steven Roberts (strobert@ata-sd.com)
Thu, 14 Jan 1999 08:55:07 -0800


Mike Jagdis wrote:
> On Tue, 12 Jan 1999, Benjamin Scherrey wrote:
> > Alan Cox wrote:
> >
> > Perhaps to get this thread back on topic you would care to clarify/comment
> > on a couple of issues that he brings up. To me, this item about multiple threads
> > blocked an a select() waking up when only one is able to successfully perform
> > the accept() would certainly appear to be a significant performance issue. My
> > question is, is this a valid criticism of the kernel implementation or simply an
> > out of scope criticism that is an example of poor application design?
>
> It's an application problem because that is exactly how
> select/poll is _defined_ to work. If you change to only wake one
> you have to change the select/poll semantics to require that
> processes handle the fd that woke them or tell the kernel to
> wake something else instead.
>
> The "thundering herd" problem is real though - if you have designed
> a system with many processes doing select/poll on the _same_ fds.
> UNIX/POSIX isn't designed for this type of program design (but other
> designs are possible...); NT is, apparently, designed for this
> type of program design - the NT theory appears to be to throw lots
> of threads in to everything. No wonder many (most?) NT programs
> are so flakey - writing solid threaded code is _hard_.

They can be difficult (I know, I write them :)

With a good design ahead of time, it isn't that bad though.

Which kind of funny, for the types of multithreaded programs I'm
writing,
LinuxThreads has done better on my tests than 95/NT. Which one of the
biggest boosts I saw under linux was actually in what I see as proper
thread scheduling. That is if I have 10 threads ready to execute the
order
in which they run is fairly random. NT was more predeictable. Makes it
harder to test for race conditions. Also, I have been really
unimpressed
with NT's SMP support, I got a dual P166 a while back and NT barely ran
as fast as a single P166. Nuked NT, installed linux on it. WOW...
Impressive. I'm even running the 2.0 series... :)

Only thing I haven't liked about LinuxThreads so far isn't a linux
problem,
but a posix one. There are some primitives in win32 I miss in posix
threads
area. But, I almost have port of my semaphores to linux ready (adds
extensions to pthreads), so I guess that complaint is going away too...
:)

>
> Mike
>
> --
> A train stops at a train station, a bus stops at a bus station.
> On my desk I have a work station...
LOL

Steve

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/