python's threading has no "interrupt"?

Jay O'Connor joconnor at cybermesa.com
Tue Dec 2 11:59:17 EST 2003


Peter Hansen wrote:

>Jay O'Connor wrote:
>  
>
>>....  When the background
>>process would wake up, since it was a higher priority, it would
>>immediately take control.  It's main job was to check the list of
>>handling processes for any that had been running too long (long running
>>processes in a web server meant that something had gone wrong) and
>>terminate them (freeing up the process and socket resources, etc..).
>>    
>>
>
>Can you describe the nature of the "something had gone wrongs" that
>you were trying to handle?  It's a very important point for a design
>like this.  Could these processes launch external programs which 
>might not exit in time?  Were they possibly buggy, encountering for
>example endless loops?  Were they dynamically loaded code written by
>others, which could mean malicious behaviour was possible?  Or something
>else?
>
>Depending on the answer, it will be either very easy to handle in Python,
>or very hard, or potentially impossible in a straightforward fashion.
>  
>

The problem is that we didn't know what it could be.  We had exception 
handlers at lower levels sufficient to handle coding bugs and file i/o 
issues.  What ususally killed us was  a network error that terminated 
the connection in mid transaction at some point  or even just the user 
hitting 'cancel' mid stream

FWIW - the 'cleanup' process running at higher priority also took care 
of some bookkeeping,  stats collecting, some memory management 
(releasing cached objects untouched for awhile so they could be GC), etc...






More information about the Python-list mailing list