This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author stanczyk
Recipients christian.heimes, gregory.p.smith, python-dev, stanczyk, twouters
Date 2020-11-24.16:30:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1606235441.58.0.304438961142.issue42443@roundup.psfhosted.org>
In-reply-to
Content
Thanks Christian for looking into this, please find my responses inlined:

> * IMO it should be called after profiling and tracing hook, so non-trivial hooks can be profiled and traced.
Makes sense, Done.

> * It's important to define and document, which thread runs the hook (calling thread or new thread).
Will update documentation when we agree upon appropriate API.

> * Since the hook is designed to monitor thread creation, would it make sense to pass the thread object to the hook?
As it's called within the context of the created thread I guess this is not needed (but as you prefer).

> * How does the hook behave when the callback raises an exception?
I guess it makes sense to do similar thing as in case of profile/trace hooks (Error in the profile function will cause itself unset). WDYT?

> * Is a single hook good enough or should the API behave more like atexit, which supports an arbitrary amount of hooks?
Feels like it makes sense to keep API similar to what profile/trace provides, otherwise it would be inconsistent.


> * Instead of just a creation hook, how about lifetime hooks are also called when a thread ends?
Sounds fine, do you mean two independent hooks (_thread_creation_hook, _thread_termination_hook) or some other form?
History
Date User Action Args
2020-11-24 16:30:41stanczyksetrecipients: + stanczyk, twouters, gregory.p.smith, christian.heimes, python-dev
2020-11-24 16:30:41stanczyksetmessageid: <1606235441.58.0.304438961142.issue42443@roundup.psfhosted.org>
2020-11-24 16:30:41stanczyklinkissue42443 messages
2020-11-24 16:30:41stanczykcreate