in reply to Re^2: Threaded RS232 communication
in thread Threaded RS232 communication
It is easy to reason (and demonstrate) that anything that has been pushed into the Queue prior to the thread being terminated, will still be in the queue and available to any other thread after the thread that queued it terminated. This obvious as were it not the case, Thread::Queue would necessarily be the source of many 'mysterious failures' in threaded code all over.
As the detached read thread will not be terminated until the main thread decides that the program is complete; and it presumably decides based upon the data it has read from the queue; it stands to reason that not only will all of the data required to make teh decision to terminate have be pushed into the queue before the process terminates, it will also have been read from it. Else, how would the main thread make its decision.
Thus, it all comes down to the efficacy of the comms protocol employed and the decision making processes based upon that protocol. The presence of threading and queuing in the communications path employed can have no influence upon either.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Threaded RS232 communication
by tobias_hofer (Friar) on Feb 01, 2013 at 11:53 UTC | |
by BrowserUk (Patriarch) on Feb 01, 2013 at 12:56 UTC | |
by tobias_hofer (Friar) on Feb 01, 2013 at 14:50 UTC |