Multiple threads or process with threads
- by sergiobuj
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!