Re: Unnoticed traceback in a thread

2018-03-11 Thread Skip Montanaro
> Concretely: instead of "start_new_thread(my_thread_function, ...)", > I use > > def wrapped_thread_function(*args, **kw): > try: > my_thread_function(*args, **kw) > except: > ... do whatever is necessary should "my_thread_function" fails ... >

Re: Unnoticed traceback in a thread

2018-03-08 Thread dieter
Skip Montanaro writes: > I have a program which is almost always running in a single thread. It > uses a daemon thread (via threading.Timer) to periodically checkpoint > some state. The program runs for days at a time. > > Over the past couple days, two instances of the

Re: Unnoticed traceback in a thread (Posting On Python-List Prohibited)

2018-03-08 Thread Rob Gaddi
On 03/08/2018 05:06 PM, Lawrence D’Oliveiro wrote: On Friday, March 9, 2018 at 11:43:00 AM UTC+13, Paul Rubin wrote: That you're using threading.Lock for something like this is a borderline code smell. Any use of multithreading in non-CPU-intensive code is a code smell. But CPU intensive

Unnoticed traceback in a thread

2018-03-08 Thread Skip Montanaro
I have a program which is almost always running in a single thread. It uses a daemon thread (via threading.Timer) to periodically checkpoint some state. The program runs for days at a time. Over the past couple days, two instances of the subthread croaked with tracebacks because while they were