Groups > Microsoft > WinDbg > Re: closing a socket while other thread does select() on it




closing a socket while other thread does select() on it

closing a socket while other thread does select() on it
Tue, 1 Apr 2008 01:40:01 -0700
How legal/illegal is it to close a socket while other thread is
waiting for this socket's event in select() ?
Some verification tools complain about this. But this seems to work
and do no harm.
Is this "false positive"complaint that's safe to ignore and
suppress ?

Thanks
Yakov

P.S. In case the thing above is not ok ..... which call shall be used
to
awake the select in the other thread when we need to close the
socket ?
Post Reply
Re: closing a socket while other thread does select() on it
Tue, 1 Apr 2008 10:45:39 +0200
This question is offtopic here. Consider asking at 
microsoft.public.win32.programmer.networks NG.

-- 
V.
This posting is provided "AS IS" with no warranties, and confers no
rights.
"Yakov" <iler.ml@gmail.com> wrote in message 
news:b30fc317-8cf8-4d37-9f19-df25b161cd6e@8g2000hsu.googlegroups.com...
> How legal/illegal is it to close a socket while other thread is
> waiting for this socket's event in select() ?
> Some verification tools complain about this. But this seems to work
> and do no harm.
> Is this "false positive"complaint that's safe to ignore and
> suppress ?
>
> Thanks
> Yakov
>
> P.S. In case the thing above is not ok ..... which call shall be used
> to
> awake the select in the other thread when we need to close the
> socket ?
> 

Post Reply
Re: closing a socket while other thread does select() on it
Tue, 1 Apr 2008 10:45:49 -0700
On Apr 1, 1:40 am, Yakov <iler...@gmail.com> wrote:
> How legal/illegal is it to close a socket while other thread is
> waiting for this socket's event in select() ?
> Some verification tools complain about this. But this seems to work
> and do no harm.
> Is this "false positive"complaint that's safe to ignore and
> suppress ?
>
> Thanks
> Yakov
>
> P.S. In case the thing above is not ok ..... which call shall be used
> to
> awake the select in the other thread when we need to close the
> socket ?


Hi,

The following weblinks should give you some pointers:

http://msdn2.microsoft.com/en-us/library/ms738547(VS.85).aspx

http://msdn2.microsoft.com/en-us/library/ms740476.aspx

http://msdn2.microsoft.com/en-us/library/ms741621(VS.85).aspx

Kellie.
Post Reply
Re: closing a socket while other thread does select() on it
Tue, 1 Apr 2008 21:18:20 -0400
It is bad practice to have a design that requires this action.  Be that as 
it may, the current, not necessarily future, versions of Windows handle this 
gracefully.



In general: If you think that  that you need this, then rethink your design 
and include some signalling mechanism to prevent the situation.


"Yakov" <iler.ml@gmail.com> wrote in message 
news:b30fc317-8cf8-4d37-9f19-df25b161cd6e@8g2000hsu.googlegroups.com...
> How legal/illegal is it to close a socket while other thread is
> waiting for this socket's event in select() ?
> Some verification tools complain about this. But this seems to work
> and do no harm.
> Is this "false positive"complaint that's safe to ignore and
> suppress ?
>
> Thanks
> Yakov
>
> P.S. In case the thing above is not ok ..... which call shall be used
> to
> awake the select in the other thread when we need to close the
> socket ?
> 

Post Reply
about | contact