Is there a recommended way to wait on multiple inputs. For example I would like my program to be able to receive input from 3 sources:
Listen on a thread condition e.g.
It certainly seems as though these three different messaging options are mutually exclusive for a single thread; how can a single thread read from stdin while it's waiting for a thread condition?
If you really don't want to spawn three threads, the only option I can fathom is somehow modifying or parameterizing the thread, stream, and socket libraries to take a reference to a synchronization object.