Multiple threads or process with threads

Posted by sergiobuj on Stack Overflow See other posts from Stack Overflow or by sergiobuj
Published on 2010-03-28T23:24:51Z Indexed on 2010/03/28 23:33 UTC
Read the original article Hit count: 626

Hi, this is for an assignment so I'm not looking for code.

I have to simulate a game where each player has turns and needs to 'pay attention' to what's going on.

So far, i know I'll need two threads for each player, one that will sleep until the player's turn and the other paying attention.

My question is: Should I work each player as a 'fork' and the threads on the fork, or just create some threads for the player and associate them somehow?

It's the first time I've worked with concurrency, semaphores and threads so I'm not sure about the good practices and programming style.

Thanks!

© Stack Overflow or respective owner

Related posts about concurrent-programming

Related posts about multithreading