when the I/O selector code :
 - queue.isEmpty() ?
 - set write flag off

write thread code :
 - queue.add(message)
 - set write flag on

there is a concurrency issue there, the write thread can set the write flag
just between the two I/O selector instructions.


On Sun, Nov 11, 2012 at 8:59 AM, Emmanuel Lécharny <[email protected]>wrote:

> Le 11/11/12 8:19 AM, Julien Vermillard a écrit :
> > yes but the problem in fact is to lock the socket write flag
> >
> Is that an issue at all ? We can't set the socket flag while waiting for
> the select() to complete, so it's done outside fo the select() call,
> thus while the selectionLoop thread is dealing with the queue. There is
> no other thread manipulating this flag.
>
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>
>

Reply via email to