Message141167
In my case, exception occured in separate thread between the begginig of the thread and starting loop.
Main thread has a code that correctly stops that separate thread. It just calls loop_thread.server.server_close() and after that, calls loop_thread.join()
So, if program termination required, but loop was not started, deadlock occur. Moreover, I can not detect if loop was started. And more more over, if I detect that loop was not started, there is chance, that it may be started a bit later, next after my checking. In that case, either loop will not be terminated correctly (if process exits) or join() may block.
So, please DO NOT ADD detection if loop was started. That will generate race-conditions in user code. I think it's never needed. If one wants to detect that, one may use separate variable:
{code}
started = True
xxx.serve_forever()
{code} |
|
Date |
User |
Action |
Args |
2011-07-26 16:25:15 | socketpair | set | recipients:
+ socketpair, pitrou, giampaolo.rodola, neologix, santoso.wijaya, petri.lehtinen |
2011-07-26 16:25:15 | socketpair | set | messageid: <1311697515.04.0.651274177774.issue12463@psf.upfronthosting.co.za> |
2011-07-26 16:25:14 | socketpair | link | issue12463 messages |
2011-07-26 16:25:14 | socketpair | create | |
|