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. Run multiple process in parallel

Run multiple process in parallel

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
4 Posts 4 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.
  • J Offline
    J Offline
    justcallmedin
    wrote on last edited by
    #1

    Hi, I want to have a program containing 2 queues. I want to pop() from both queues at the same time. It is like two threads. Did anybody know how to do it? Thank you.

    M D A 3 Replies Last reply
    0
    • J justcallmedin

      Hi, I want to have a program containing 2 queues. I want to pop() from both queues at the same time. It is like two threads. Did anybody know how to do it? Thank you.

      M Offline
      M Offline
      Milton Karimbekallil
      wrote on last edited by
      #2

      Yes, You can have two STL queues and have the threads read from both simultaniously. Remember to lock the queues using CCriticalSection in case both threads accessing the same queue. cheers ...mil10.

      1 Reply Last reply
      0
      • J justcallmedin

        Hi, I want to have a program containing 2 queues. I want to pop() from both queues at the same time. It is like two threads. Did anybody know how to do it? Thank you.

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

        justcallmedin wrote:

        I want to pop() from both queues at the same time.

        Technically, true parallelism cannot be achieved on a uniprocessor machine. I doubt if that's what you were really after anyway, however.


        "Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain

        "There is no death, only a change of worlds." - Native American Proverb

        1 Reply Last reply
        0
        • J justcallmedin

          Hi, I want to have a program containing 2 queues. I want to pop() from both queues at the same time. It is like two threads. Did anybody know how to do it? Thank you.

          A Offline
          A Offline
          Arvind Bharti
          wrote on last edited by
          #4

          I am confused with the subject and the content of message. Subject states you want multiple processes and message talks about threads. Could you please be more specific? In case of process, use kernel-objects like events, mutex, semaphore etc. to synchronize and for threads you can use user-objects like critical section(as well as kernel-objects).

          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