Original Post
My question is thus. I've done some thread programming (I find it fun) And need to once again pull on this resource. However this time (for a game I'm programming currently technically) I'm looking for a way for the threads to communicate. There appears to be a lot of ways but I don't see one that is easily explained in my search and haven't done too many deep probes on any one topic because none seem perfect for my problem. My problem is this. I'm working on a program where there's the graphics thread, Network thread, and Logic thread (as well as an engine overseer that creates and controls the threads if it matters, though it's the main program) I then Have these situations. Logic needs input from user on which move to make, Graphics (the input and graphics thread) needs to know to show screen "B" allow the user to select option X and then return to logic which option was selected. (in this case select a card from a hand) I would also like network to be able to tell graphics what moves Player B is making. (Assuming B is not local) Is there anyway? I would prefer a compact way to do this as Graphics and logic tend to need to communicate almost every second (as any time a person makes a move the graphics has to recieve the move, tell logic what move it is and then what logic needs to tell graphics "I need this data") Is there a good way to communicate between the threads in this situation? I've pretty much no experience in most of the ways suggested from what I've seen.