Re: SMP: protocol control block protection for a multithreaded process (ex: udp).

2012-05-29 Thread Robert N. M. Watson
On 29 May 2012, at 21:09, vasanth rao naik sabavat wrote: > I am trying to understand the socket <--> protocol layer as part of our > project. I was trying to understand why the sotoinpcb() is called before > taking any locks. Also, I am trying to understand scenario of a > multi-threaded proc

Re: SMP: protocol control block protection for a multithreaded process (ex: udp).

2012-05-29 Thread vasanth rao naik sabavat
Hi Robert, I am trying to understand the socket <--> protocol layer as part of our project. I was trying to understand why the sotoinpcb() is called before taking any locks. Also, I am trying to understand scenario of a multi-threaded process trying to do socket operations simultaneously on a mult

Re: SMP: protocol control block protection for a multithreaded process (ex: udp).

2012-05-29 Thread Robert N. M. Watson
On 29 May 2012, at 18:06, vasanth rao naik sabavat wrote: > My main concern is about the protocol control block "inp", a reference in the > socket structure. the udp_detach() free'es the inp but there is a potential > for other thread running udp_* functions to get hold of the reference? Also,

Re: SMP: protocol control block protection for a multithreaded process (ex: udp).

2012-05-29 Thread vasanth rao naik sabavat
Hello Robert, My main concern is about the protocol control block "inp", a reference in the socket structure. the udp_detach() free'es the inp but there is a potential for other thread running udp_* functions to get hold of the reference? Also, sofree() calls SOCK_UNLOCK() which potentially may al

Re: SMP: protocol control block protection for a multithreaded process (ex: udp).

2012-05-29 Thread Robert Watson
On Tue, 29 May 2012, vasanth rao naik sabavat wrote: Can somebody please reply to this email. basically, can udp_detach() and udp_send() execute simultaneously for a process with multiple threads? if yes, then inp reference in udp_send() will be stale if udp_detach() free's the inp? You ar

Re: SMP: protocol control block protection for a multithreaded process (ex: udp).

2012-05-29 Thread Robert Watson
On Tue, 29 May 2012, vasanth rao naik sabavat wrote: In case of a Multicore cpu system running a multithreaded process. For protocol control blocks there is no protection provided in the FreeBSD 9. For example, udp_close() and udp_send() access the inp before taking the lock. Couldn't this c

Re: SMP: protocol control block protection for a multithreaded process (ex: udp).

2012-05-29 Thread vasanth rao naik sabavat
Can somebody please reply to this email. basically, can udp_detach() and udp_send() execute simultaneously for a process with multiple threads? if yes, then inp reference in udp_send() will be stale if udp_detach() free's the inp? Thanks, Vasanth On Tue, May 29, 2012 at 10:53 AM, vasanth rao n

SMP: protocol control block protection for a multithreaded process (ex: udp).

2012-05-29 Thread vasanth rao naik sabavat
Hi, In case of a Multicore cpu system running a multithreaded process. For protocol control blocks there is no protection provided in the FreeBSD 9. For example, udp_close() and udp_send() access the inp before taking the lock. Couldn't this cause the inp inconsistency on a multithreaded process