lock and release sock

From: Akshay Adhikari (adhikari@vsnl.com)
Date: Wed Jun 14 2000 - 23:18:47 EST


Hi

I wanted to know in what situations is locking of a socket (lock_sock) and
releasing the lock required? In kernel 2.0.36, I saw atleast 2 instances -

1. In skb_recv_datagram, just before checking that the sk's receive q is
empty. I guess that;s done so that we dont get any new packets after finding
the q empy. But is there any real danger there? Because anyway, before going
to sleep in wait_for_packet we cli () and check again that the q is empty.

2. In tcp's close - while doing a half-close - the comment above lock_sock
says (not exactly in these words) - "so we dont recv any more data on this
socket."

So could someone tell me some situations where one would NOT want to receive
data / prevent state change of the socket by a bottom half handler?

Thanks in advance
Akshay

-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.rutgers.edu



This archive was generated by hypermail 2b29 : Thu Jun 15 2000 - 21:00:41 EST