lkml.org 
[lkml]   [2000]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectlock_sock()
Hi,

I noticed that the TCP code (linux 2.2.14) locks the
socket (using lock_sock()) before doing a send
(tcp_do_sendmsg), and during a receive
(tcp_recvmsg).
Besides that, I have seen lock_sock() being called
at a number of other places in the TCP code.

Could someone please explain to me the working of
lock_sock(), and in what cases it should be called?

The reason I am looking at lock_sock is because I
have a project in which I create 2 INET sockets (say
s1
and s2), and each socket can receive data, that it
sends down through the other. For ex: s1 receives some
data, processes it, and sends it through s2, and vice
versa.
I think I have to lock the socket that I am sending
data down on, but am not too sure if I have to lock
the receiving socket as well.
Any help or tips would be very much appreciated.

Thanks,
Mahesh.


__________________________________________________
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
http://invites.yahoo.com/

-
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/

\
 
 \ /
  Last update: 2005-03-22 13:57    [W:0.287 / U:0.868 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site