On Fri, May 30, 2014 at 1:59 PM, Ethan Furman wrote:
> Given the use-case (must shut down, cannot risk a hung process, orphan files
> be damned) I don't think having a daemon thread die because it raised an
> exception trying to access a missing global is a big deal.
It's certainly suboptimal. Su
On 05/30/2014 01:47 PM, Devin Jeanpierre wrote:
Don't use daemon threads, they are inherently un-thread-safe: any
global access you do anywhere inside a daemon thread can fail, because
daemon threads are still potentially run during interpreter shutdown,
when globals are being deleted from every
Don't use daemon threads, they are inherently un-thread-safe: any
global access you do anywhere inside a daemon thread can fail, because
daemon threads are still potentially run during interpreter shutdown,
when globals are being deleted from every module. Most functions you
might call are not safe
On Thursday, May 29, 2014 1:15:35 AM UTC-7, Chris Angelico wrote:
> On Thu, May 29, 2014 at 11:20 AM, Carl Banks wrote:
>
> > Most threads have cleanup work to do (such as deleting temporary
> > directories and killing spawned processes).
>
> >
>
> > For better or worse, one of the requirement
On Thu, May 29, 2014 at 11:20 AM, Carl Banks wrote:
> Most threads have cleanup work to do (such as deleting temporary directories
> and killing spawned processes).
>
> For better or worse, one of the requirements is that the library can't cause
> the program to hang no matter what...
This ma y
On 28May2014 18:20, Carl Banks wrote:
Here's the solution I came up with: in the library's init function, it will
start a non-daemon thread that simply joins the main thread, and then asks all
existing worker threads to exit gracefully before timing out and leaving them
to be killed. So if a
Greetings,
> Ok, so I have an issue with cleaning up threads upon a unexpected exit.
What do you mean by "unexpected exit"? Uncaught exception? SIGTERM? ...
> Using atexit doesn't work because it's called after the daemon threads are
> killed.
I don't follow. Who is killing the daemon threads?