[vlc-devel] [PATCH 1/3] poll: keep already signaled events that are not used between calls

Steve Lhomme robux4 at gmail.com
Fri Nov 27 13:52:49 CET 2015

If by "this patch makes no sense" you mean that it won't work when the
`struct polld` is not reused between calls, I agree. Looking at the
code it seems to be the general case.

So now depending on the state of the stack I get `revents` values
coming from nowhere.

IMO if we want to use WSAEnumNetworkEvents() we need to keep the state
of previously set events that are not used (ie a matching send() or
recv() call is done). That would explain when the events that are
missed while waiting. After they are events, not states. But that
sounds like an impractical solution because we would need to check all
calls to poll() if the event is actually used or if it needs to be

I think we should use the non alertable code and add alertable support
via other ways than WSAEnumNetworkEvents(). I found solutions that
propose to use an extra socket that the caller waits for and signal it
when the wait must be canceled. That would involve using the Thread
Local Storage to store that socket so it can be used by
vlc_cancel_self. That's not overly complex, but it may slow things do
a bit.

On Fri, Nov 27, 2015 at 11:56 AM, Rémi Denis-Courmont <remi at remlab.net> wrote:
> Le 2015-11-26 19:57, Steve Lhomme a écrit :
>> ---
>>  compat/poll.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
> This patch makes no sense.
> --
> Rémi Denis-Courmont
> http://www.remlab.net/
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel

More information about the vlc-devel mailing list