To avoid infinitely blocking, reading from queues shouldn't happen on the thread merge is happening on.
To avoid synchronization or infinitely waiting for one of queues while other has data, reading from queues shouldn't happen on same thread.
Let's start by defining and populating two queues:...