Re: [gnet-dev] Re: Glib win32 iochannels update



On Tue, 13 May 2003 Andrewlanoix aol com wrote:
> I have discovered what the problem is, or at least the first problem.
> There is an issue with the way the socket threads in glib on win32 are
> synchronized when you add a second watch to the iochannel.
>
> Basically the code checks to see what conditions to look for, G_IO_IN
> etc across all watches and then does a select() call which goes to
> sleep on those conditions. It does not wake up until one of those
> conditions is met. This means that if you do a G_IO_IN, followed by a
> G_IO_OUT g_io_add_watch() call, the second will not happen until the
> first call happens on that socket.

Ugh.  Multiple watches on a single IOChannel causes problems in Linux too.
Is this problem with the core GLib code or just with the Win32 specific
code?

> The simple fix to this problem is to have a timeout on the select()
> call. When the timeout occurs do a continue; to restart the loop to
> reload the conditions to select() on. However, I do not know what a
> reasonable timeout should be. I am going to talk to David and
> investigate other options.

Will that work?  The best solution would be to select on all the
conditions in first place.

David


-- 
David Helder - dhelder umich edu - <http://www.eecs.umich.edu/~dhelder>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]