Hello there, mates!
I have a multi-threaded app with threads waiting on a queue events and then handling them.
The processing is like
class MyThreadClass(Thread): def __init__(self, account, notificationQueue, commandQueue): super().__init__(name='MyThreadClass', daemon=True) def run(self) -> None: while True: queueData = self.commandQueue.get(block=True, timeout=None) self.doSomething(queueData) pass def doSomething(data) print('debug 1') # some other code print('debug 2') # some other code print('debug 3') # some other code ### The threads are started something like threadClass = MyThreadClass() threadClass.start()
I observe that when I have a thread’s subroutine
doSomething running if I suspend the operating system then it sticks at one of the debug statements and then nothing happens after i wake up the system.
Even though the messages are coming to the ‘commandQueue’ the thread never seems to get control back from the ‘doSomething’ subroutine which is ‘stuck’ when the operating system is suspended.
Am I missing something in the way I configure/start the threads?
Or maybe I should be handling operating system suspend events?
P.S. Sorry about the way I name variables. It’s coming from Java style.