[Python-ideas] Responsive signal handling

M.-A. Lemburg mal at egenix.com
Mon Jun 22 10:16:52 CEST 2015


On 22.06.2015 04:16, Devin Jeanpierre wrote:
> On the topic of obscure concurrency trivia, signal handling in Python
> is not very friendly, and I'm wondering if anyone is interested in
> reviewing changes to fix it.
> 
> The world today: handlers only run in the main thread, but if the main
> thread is running a bytecode (e.g. a call to a C function), it will
> wait for that first. For example, signal handlers don't get run if you
> are in the middle of a lock acquisition, thread join, or (sometimes) a
> select call, until after the call returns (which may take a very long
> time).

IMO, the above can easily be solved by going with an application
design which doesn't use the main thread for any long running
tasks, but instead runs these in separate threads.

I don't know what the overall situation is today, but at least in
the past, signal handling only worked reliably across platforms
in the main thread of the application.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Jun 22 2015)
>>> Python Projects, Coaching and Consulting ...  http://www.egenix.com/
>>> mxODBC Plone/Zope Database Adapter ...       http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
2015-06-16: Released eGenix pyOpenSSL 0.13.10 ... http://egenix.com/go78
2015-06-10: Released mxODBC Plone/Zope DA 2.2.2   http://egenix.com/go76
2015-07-20: EuroPython 2015, Bilbao, Spain ...             28 days to go

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/


More information about the Python-ideas mailing list