Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Your thoughts on multi-threaded client run on the same machine.

Your thoughts on multi-threaded client run on the same machine.

Scheduled Pinned Locked Moved C / C++ / MFC
c++sysadminperformancetutorialdiscussion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    deltaseq0
    wrote on last edited by
    #1

    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

    M 1 Reply Last reply
    0
    • D deltaseq0

      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

      M Offline
      M Offline
      Moak
      wrote on last edited by
      #2

      > 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

      D 1 Reply Last reply
      0
      • M Moak

        > 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

        D Offline
        D Offline
        deltaseq0
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups