Curious question about FreeBSD's TCP/IP and SMP locking

Chuck Swiger cswiger at mac.com
Sun Aug 1 11:02:01 PDT 2004


Patrick Dung wrote:
> I am not programmer but I want to know what is the use
> of adding so much locks/mutex in the stack?

So that it works properly under SMP.
Concurrent programming is really hard to do.

> Also, would it make a newbie/beginner feel difficult to
> understand the code (I mean the TCP/IP part)?

Why, yes, certainly it does.  Beyond that, the size of the code involved 
implies something about the complexity:

8-epia# wc -l /usr/src/sys/netinet/tcp_input.c
     3349 /usr/src/sys/netinet/tcp_input.c

-- 
-Chuck



More information about the freebsd-questions mailing list