[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Porting and Extending a TCP/IP noise simulator from kernel 2.2.x to 2.4.x
On Thu, Jul 19, 2001, Shlomi Fish wrote about "Re: Porting and Extending a TCP/IP noise simulator from kernel 2.2.x to 2.4.x":
> > some parts were completely rewritten (e.g. the firewalling code). i think
> > most changes that got to do with what u call 'multi-threaded processes' is
> > actually not related to threads specifically - but to paralel execution in
> > general - and got to do with having mroe fine-grained usage of locks
> > inside the kernel, to allow taking better advantage of existance of
> > seveval CPUs in SMP mode.
> >
>
> No, the problem was that in kernel 2.2.x the TCP/IP stack was not
> multi-threaded. That is a blocking accept() call would have blocked the
> entire process, and if one thread sent data the other would get stuck,
> etc. etc.
As far as I understand, Guy was right, and your correction isn't. I have
written multi-threaded communication programs running on kernels 2.2, and
I never had problems like you describe. I don't remember if I used accept(),
but I certainly used a blocking read(), select() and stuff like that, and
multithreaded behavior was fine.
I think indeed the purpose of the changes in 2.4 was to make the kernel
behave better on SMP machines with more than 2 processors (4, 8, etc.),
on which previous kernels had too much locking overhead and waits. 2.2
kernels worked fine on 2-processor SMPs, but didn't scale well to machines
with more processors.
But correct me if I'm wrong.
P.S. As far as the Linux kernel is concerned, threads and processes are
the same thing (the only difference is that they share memory, and some
other things like file descriptors). So if the problems you describe exist
(I think they don't), they're probably bugs in the glibc library, not in
the kernel.
--
Nadav Har'El | Thursday, Jul 19 2001, 28 Tammuz 5761
nyh@math.technion.ac.il |-----------------------------------------
Phone: +972-53-245868, ICQ 13349191 |New! Divorcee Barbie! Comes with all the
http://nadav.harel.org.il |usual accessories, plus all of Ken's stuff
=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il