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. how to manage multi data input.

how to manage multi data input.

Scheduled Pinned Locked Moved C / C++ / MFC
questioncssiotdata-structuresperformance
5 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.
  • M Offline
    M Offline
    Max
    wrote on last edited by
    #1

    My project is about monitoring four sensor measurement from USB port. In each sensor give me the data for plot graph in the same client area. Because it is high speed input data (less than millisecond),so I separate each sensor data that I get in four thread and each thread use same client area to plot the graph. So,It possible in each thread will plot the graph on client area in the same time. My question is that when this occur the program will crash or not? if the answer is "crash". What about when I separate view in four view by splitter but same mainframe? if the answer still "crash". Please advise me the solution for this issue.

    _ 1 Reply Last reply
    0
    • M Max

      My project is about monitoring four sensor measurement from USB port. In each sensor give me the data for plot graph in the same client area. Because it is high speed input data (less than millisecond),so I separate each sensor data that I get in four thread and each thread use same client area to plot the graph. So,It possible in each thread will plot the graph on client area in the same time. My question is that when this occur the program will crash or not? if the answer is "crash". What about when I separate view in four view by splitter but same mainframe? if the answer still "crash". Please advise me the solution for this issue.

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      There can be a "crash" when multiple threads access the same resource. In your case it is the device context of the view. You must use a critical section to lock the drawing code so that a thread cannot draw to the DC till other threads have released it.

      «_Superman_»

      M 1 Reply Last reply
      0
      • _ _Superman_

        There can be a "crash" when multiple threads access the same resource. In your case it is the device context of the view. You must use a critical section to lock the drawing code so that a thread cannot draw to the DC till other threads have released it.

        «_Superman_»

        M Offline
        M Offline
        Max
        wrote on last edited by
        #3

        What about separate it to different process and different plot client area. Is it still crash ?

        _ 1 Reply Last reply
        0
        • M Max

          What about separate it to different process and different plot client area. Is it still crash ?

          _ Offline
          _ Offline
          _Superman_
          wrote on last edited by
          #4

          Then it will not because now there is no client areas being shared by multiple threads.

          «_Superman_»

          M 1 Reply Last reply
          0
          • _ _Superman_

            Then it will not because now there is no client areas being shared by multiple threads.

            «_Superman_»

            M Offline
            M Offline
            Max
            wrote on last edited by
            #5

            Can you give me some technic for mix multiple process and show on different client area but all process run on same program.

            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