What is a good method to use with multithreading to simulate this?

Posted by user1504257 on Stack Overflow See other posts from Stack Overflow or by user1504257
Published on 2012-11-19T22:40:43Z Indexed on 2012/11/19 23:00 UTC
Read the original article Hit count: 272

Filed under:
|
|

I am writing a program in c++ in visual studio to be able to handle a line at a park. I have all of my customers in a line at the park and I want to be able to service them using multithreading with openmp.

When I put the pragma and such in, I have multiple threads servicing the same customer at the same time for each and every customer I create, not what I want.

I want for example, if I had two threads and four customers, that thread one to do customer one while thread 2 does customer 2. Then I would like thread 1 to do customer 3 and thread 2 customer 4 at the same time. I don't know if its possible or if there is a better way, but I need to use openmp. Thanks for your input.

© Stack Overflow or respective owner

Related posts about c++

Related posts about visual-studio-2010