I'm working on a concurrent program; it has two threads, one of which listens messages from a server and the other one sends messages to it.
I need to obtain commands from the user (using cin?) and show messages coming from the server both at the same time.
How can I handle that situation? The problem is that if I'm reading a command from the user when a message comes, the user's input is messed up with other stuff.
Thanks in advance
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…