In my C++ game program, how do I write a function that accepts an input per turn from a bot running on a separate thread? The function should update the game state immediately upon receiving the input but will wait no more than x seconds.
Or, using tools such as events, messages, mail boxes, semaphores, shared memory, others, how can I achieve this?