Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Apr 2002 10:18:01 -0400 (EDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Seigo Tanimura <tanimura@r.dl.itc.u-tokyo.ac.jp>
Cc:        Seigo Tanimura <tanimura@nkth.carrots.uucp.r.dl.itc.u-tokyo.ac.jp>, smp@FreeBSD.org, current@FreeBSD.org
Subject:   RE: Locking down a socket, milestone 1
Message-ID:  <XFMail.20020424101801.jhb@FreeBSD.org>
In-Reply-To: <200204241110.g3OB8u8t006194@bunko>

next in thread | previous in thread | raw e-mail | index | archive | help

On 24-Apr-2002 Seigo Tanimura wrote:
> I am now working on locking down a socket.  (I have heard that Jeffrey
> Hsu is also doing that, but I have never seen his patch.  Has anyone
> seen that?) My first milestone patch is now available at:
> 
> 
> http://people.FreeBSD.org/~tanimura/patches/socket_milestone1.diff.gz
> 
> 
> The works I have done so far are:
> 
> 
> - Determine the lock required to protect each of the members in struct
>   socket.
> 
> - Add mutexes to each of the sockbufs in a socket as BSD/OS does.
> 
> - Lock down so_count, so_options, so_linger and so_state.
> 
> - Add a global mutex socq_lock to protect the connection queues of a
>   listening socket.  Lock socq_lock to lock two sockets at once,
>   followed by enqueuing or dequeuing a socket, or moving a socket across
>   queues.  socq_lock is not an sx lock because we usually have to lock
>   two sockets to modify them.

Do you actually lock two sockets at once or do you lock one at a time while
holding socq_lock.  If you do lock two at once, what is the defined locking
order?

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-smp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20020424101801.jhb>