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. Real time drawing using multithreading

Real time drawing using multithreading

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsdesigndockerdata-structuresregex
6 Posts 3 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.
  • F Offline
    F Offline
    FrankStar89
    wrote on last edited by
    #1

    Hello there, I am looking for the best Way/Strategy to "Continuously read data from the HW in real-time and draw some GUI-diagram in Parallel". Performance would be a big matter here since the graph has to be drawn in real-time. Its just coming to my mind about 1) creating 1 worker-thread for reading process, and 2) another for GUI drawing. But I am looking for perfection and suggestions here. 1) Is there any specific Design-Pattern that would fit this?. If so, please suggest. 2) Whats the best way(container) to read data by the worker-thread and keep it for the GUI-thread to process. FIFO? or some other class? Thanks in advance for your suggestion and advice.

    J D 2 Replies Last reply
    0
    • F FrankStar89

      Hello there, I am looking for the best Way/Strategy to "Continuously read data from the HW in real-time and draw some GUI-diagram in Parallel". Performance would be a big matter here since the graph has to be drawn in real-time. Its just coming to my mind about 1) creating 1 worker-thread for reading process, and 2) another for GUI drawing. But I am looking for perfection and suggestions here. 1) Is there any specific Design-Pattern that would fit this?. If so, please suggest. 2) Whats the best way(container) to read data by the worker-thread and keep it for the GUI-thread to process. FIFO? or some other class? Thanks in advance for your suggestion and advice.

      J Offline
      J Offline
      jschell
      wrote on last edited by
      #2

      FrankStar89 wrote:

      Performance would be a big matter here since the graph has to be drawn in real-time.

      How many points per second? Presumably there is no data munging at all?

      F 1 Reply Last reply
      0
      • F FrankStar89

        Hello there, I am looking for the best Way/Strategy to "Continuously read data from the HW in real-time and draw some GUI-diagram in Parallel". Performance would be a big matter here since the graph has to be drawn in real-time. Its just coming to my mind about 1) creating 1 worker-thread for reading process, and 2) another for GUI drawing. But I am looking for perfection and suggestions here. 1) Is there any specific Design-Pattern that would fit this?. If so, please suggest. 2) Whats the best way(container) to read data by the worker-thread and keep it for the GUI-thread to process. FIFO? or some other class? Thanks in advance for your suggestion and advice.

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        For worker threads, read here.

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

        F 1 Reply Last reply
        0
        • J jschell

          FrankStar89 wrote:

          Performance would be a big matter here since the graph has to be drawn in real-time.

          How many points per second? Presumably there is no data munging at all?

          F Offline
          F Offline
          FrankStar89
          wrote on last edited by
          #4

          Thanks Jschell. I am not sure yet how many points per sec. ( still in the initial stage.) I think there would be data munging for sure. Anyway, what I was looking here mostly any "usual Design Pattern" for this kind of problem in general. (1 thread is reading and another is drawing simultaneously). Thanks again.

          J 1 Reply Last reply
          0
          • D David Crow

            For worker threads, read here.

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

            F Offline
            F Offline
            FrankStar89
            wrote on last edited by
            #5

            Thanks David, That would surely be helpful.

            1 Reply Last reply
            0
            • F FrankStar89

              Thanks Jschell. I am not sure yet how many points per sec. ( still in the initial stage.) I think there would be data munging for sure. Anyway, what I was looking here mostly any "usual Design Pattern" for this kind of problem in general. (1 thread is reading and another is drawing simultaneously). Thanks again.

              J Offline
              J Offline
              jschell
              wrote on last edited by
              #6

              FrankStar89 wrote:

              I am not sure yet how many points per sec.

              That of course would be the first requirement before proceeding. It impacts everything.

              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