Your thoughts on multi-threaded client run on the same machine.
-
I have only a modicum of basic knowledge about programming in VC++6. Most of the time I am cold so I program to raise my body temperature by the unadulterated frustration C++ affords. However, this frustration is offset by the learning experience. I’ve written a newsgroup client that downloads headers and articles from up to 10 newsgroups and deletes duplicates. My socket connection is derived from CAsyncSocket. It seems to run OK but since I have time, I was wondering if modifying the code by adding multi-threading would improve download performance. (I don’t even know if that is possible.) My newsgroup server allows 2 connections per host. I connect via a cable modem, only one PC is involved, and no router. My thought was that I might see only a marginal improvement since some delays, for example within the server, would still exist. Regards
-
I have only a modicum of basic knowledge about programming in VC++6. Most of the time I am cold so I program to raise my body temperature by the unadulterated frustration C++ affords. However, this frustration is offset by the learning experience. I’ve written a newsgroup client that downloads headers and articles from up to 10 newsgroups and deletes duplicates. My socket connection is derived from CAsyncSocket. It seems to run OK but since I have time, I was wondering if modifying the code by adding multi-threading would improve download performance. (I don’t even know if that is possible.) My newsgroup server allows 2 connections per host. I connect via a cable modem, only one PC is involved, and no router. My thought was that I might see only a marginal improvement since some delays, for example within the server, would still exist. Regards
> if modifying the code by adding multi-threading would improve download performance My short answer is: No. CAsyncSocket was designed to handle multiple sockets in one thread context (if you can have 2 connections to the server it's possible to create two socket instances in your application and split up download tasks among them). You could try a completely different socket architecture (with something else than CAsyncSocket), I don't see the need in your example. /M
-
> if modifying the code by adding multi-threading would improve download performance My short answer is: No. CAsyncSocket was designed to handle multiple sockets in one thread context (if you can have 2 connections to the server it's possible to create two socket instances in your application and split up download tasks among them). You could try a completely different socket architecture (with something else than CAsyncSocket), I don't see the need in your example. /M
Thanks Moak. I've come to the same conclusion. Others have suggested that a mult-thread app might include 1 for the connection and another for fuctions that could be done in parallel such as sorting, filtering and displaying. This also does not help much since there are not a lot of intensive other tasks to do. I use XHDR commands which is fast and download the article bodies afterwards for those articles I'm interested in. Regards