Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 May 2012 16:20:09 -0400
From:      vasanth rao naik sabavat <vasanth.raonaik@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   Re: SMP: protocol control block protection for a multithreaded process (ex: udp).
Message-ID:  <CAAuizBhn_QT4WCh1ZRyc%2BHBkOYGaGivsVGm4oLj-i9VY7a5wxw@mail.gmail.com>
In-Reply-To: <CAAuizBjhGUUH3D3XN1t7WMnOPTq0vZjnV1QXGrR99qBOD34rGQ@mail.gmail.com>
References:  <CAAuizBjhGUUH3D3XN1t7WMnOPTq0vZjnV1QXGrR99qBOD34rGQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 naik sabavat <
vasanth.raonaik@gmail.com> wrote:

> 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
> running on multicore cpu system?
>
> Say, If the two threads of a process are concurrently executing socket
> send and socket close say on a udp connection (this can happen in case of
> poorly written user code.).
> udp_close() will access the inp on one cpu and udp_send() will access the
> inp on another cpu. it is possible that udp_close() gets the locks first
> and free's the inp before udp_send() has a chance to run?
>
> Am I missing anything?
>
> Thanks,
> Vasanth
>
>
>
>
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAAuizBhn_QT4WCh1ZRyc%2BHBkOYGaGivsVGm4oLj-i9VY7a5wxw>