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