>
> in my experience non-blocking sockets are hardly ever needed.
Agreed, but that is the way Dmitry had implemented things.
> Presumably the
> situation is like this: you have one task that needs to read from the
> socket,
> write to the socket, and also remove stuff to send from a queue. The
> problem
> being that if you are blocking on reading from the queue then you aren't
> servicing the socket, and if you are blocking on the socket then you aren't
> noticing items being added to the queue.
>
Exactly
>
> One solution, which sounds like what you did, is to have one task for
> reading
> from the socket, and another for getting stuff from the queue and writing
> it to
> the socket.
Right and I am using a PO to block the write task when nothing is in any
queue in the latest update so CPU goes to zero when there is now work to be
done. I still need to clean it up, but I am being lazy to first see where
Dmitry wants to go. I don't want to fork his work if not needed, but he
still seems partial to a single worker thread.
> A different solution is to introduce signalling sockets:
I mentioned the idea of using and out-of-band signal if he wants to stick
with one task. Will see.
David Botton
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Gnoga-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gnoga-list