Hi,
I'm trying to put together a "threading" example, that has not academic, but practical value.
I thought of people that need to answer questions (or Multiple choices) and have eg. 10 seconds to do so.
The timer is in a separate thread.
So far so good, only I hit a problem: the console input(...) function, while waiting for a user input, seems to
block out any messages coming from the timer thread (style: 'your time is up, next question".)
They only appear after the user has entered something, even after a minute....
Indeed, when I consult the internet for such apps, authors move away from threading to entirely different methods.
Question: can anybody confirm that the console input(...) statement will block out messages coming from a 2nd thread.
PS. There is a solution, i.e. using a GUI. But that makes the example less "pure" with almost a majority
of statements not directly related to "threading".
I would prefer input(...) but maybe that is even more complicated.
If I'm wrong, I'll continue testing... :-)
thx,
Paul
I'm trying to put together a "threading" example, that has not academic, but practical value.
I thought of people that need to answer questions (or Multiple choices) and have eg. 10 seconds to do so.
The timer is in a separate thread.
So far so good, only I hit a problem: the console input(...) function, while waiting for a user input, seems to
block out any messages coming from the timer thread (style: 'your time is up, next question".)
They only appear after the user has entered something, even after a minute....
Indeed, when I consult the internet for such apps, authors move away from threading to entirely different methods.
Question: can anybody confirm that the console input(...) statement will block out messages coming from a 2nd thread.
PS. There is a solution, i.e. using a GUI. But that makes the example less "pure" with almost a majority
of statements not directly related to "threading".
I would prefer input(...) but maybe that is even more complicated.
If I'm wrong, I'll continue testing... :-)
thx,
Paul