On Mon, Jun 22, 2009 at 6:17 AM, Peng Jing<pj.phan...@yahoo.com.cn> wrote:
> 2).
> I plan to employ some multi-threading: one thread keeps listenning to the
> incoming commands from the server, put them in a cache, and the other thread
> scans the cache and pick out those complete commands and enqueue them. But
> this may involve some thread synchronization problems which are a little
> difficult and tedious to deal with.
> Does anyone have some good ideas?

One popular technique for network I/O is to watch the network socket
for incoming data, then call read() when you know there is something
to be read.  The poll() and select() functions are the traditional
ways of doing this.  libevent and libev are probably more convenient,
if you want to support multiple-platforms.  Or if you're developing a
glib application you can use GIOChannels.

-Mark

_______________________________________________
Support mailing list
Support@pidgin.im
http://pidgin.im/cgi-bin/mailman/listinfo/support

You can unsubscribe from the list's website above.

Reply via email to