Re: Cross-platform time out decorator

2007-10-01 Thread Gabriel Genellina
En Mon, 01 Oct 2007 04:34:38 -0300, Joel <[EMAIL PROTECTED]> escribi�: > On Sep 27, 10:40 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: >> You can use ctypes and the Python API to raise a Python exception in >> the thread. > Could you point me to an example of how to do that? Found this:

Re: Cross-platform time out decorator

2007-10-01 Thread Joel
On Sep 27, 10:40 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On 9/27/07, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > > > > > Joel <[EMAIL PROTECTED]> writes: > > > >> Note that, unlike the original alarm code, it doesn't really interrupt > > >> the timed-out method, it just returns the control b

Re: Cross-platform time out decorator

2007-09-27 Thread Hrvoje Niksic
"Chris Mellon" <[EMAIL PROTECTED]> writes: > You can use ctypes and the Python API to raise a Python exception in > the thread. How, by changing the thread's exception state? -- http://mail.python.org/mailman/listinfo/python-list

Re: Cross-platform time out decorator

2007-09-27 Thread Chris Mellon
On 9/27/07, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > Joel <[EMAIL PROTECTED]> writes: > > >> Note that, unlike the original alarm code, it doesn't really interrupt > >> the timed-out method, it just returns the control back to the caller, > >> using an exception to mark that a timeout occurred.

Re: Cross-platform time out decorator

2007-09-27 Thread Hrvoje Niksic
Joel <[EMAIL PROTECTED]> writes: >> Note that, unlike the original alarm code, it doesn't really interrupt >> the timed-out method, it just returns the control back to the caller, >> using an exception to mark that a timeout occurred. The "timed out" >> code is still merrily running in the backgr

Re: Cross-platform time out decorator

2007-09-27 Thread Tim Golden
Steve Holden wrote: > Joel wrote: >> On Sep 27, 4:36 pm, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: >>> Joel <[EMAIL PROTECTED]> writes: I found the solution : http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440569 describes a solution based on threads. I tested it and it works

Re: Cross-platform time out decorator

2007-09-27 Thread Steve Holden
Joel wrote: > On Sep 27, 4:36 pm, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: >> Joel <[EMAIL PROTECTED]> writes: >>> I found the solution : >>> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440569 >>> describes a solution based on threads. I tested it and it works >>> perfectly. >> Note tha

Re: Cross-platform time out decorator

2007-09-27 Thread Joel
On Sep 27, 4:36 pm, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > Joel <[EMAIL PROTECTED]> writes: > > I found the solution : > >http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440569 > > describes a solution based on threads. I tested it and it works > > perfectly. > > Note that, unlike the o

Re: Cross-platform time out decorator

2007-09-27 Thread Hrvoje Niksic
Joel <[EMAIL PROTECTED]> writes: > I found the solution : > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440569 > describes a solution based on threads. I tested it and it works > perfectly. Note that, unlike the original alarm code, it doesn't really interrupt the timed-out method, it

Re: Cross-platform time out decorator

2007-09-27 Thread Joel
On Sep 26, 12:21 pm, Joel <[EMAIL PROTECTED]> wrote: > I've been using this nice timing out decorator > :http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/307871. The > problem is that since it relies on sigalarm, it doesn't work under > windows. Would anyone know how to do a cross-platform

Re: Cross-platform time out decorator

2007-09-27 Thread kyosohma
On Sep 26, 5:21 am, Joel <[EMAIL PROTECTED]> wrote: > I've been using this nice timing out decorator > :http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/307871. The > problem is that since it relies on sigalarm, it doesn't work under > windows. Would anyone know how to do a cross-platform v

Re: Cross-platform time out decorator

2007-09-27 Thread Tim Golden
Joel wrote: > I've been using this nice timing out decorator : > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/307871 . The > problem is that since it relies on sigalarm, it doesn't work under > windows. Would anyone know how to do a cross-platform version? I don't think you're going to

Cross-platform time out decorator

2007-09-26 Thread Joel
I've been using this nice timing out decorator : http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/307871 . The problem is that since it relies on sigalarm, it doesn't work under windows. Would anyone know how to do a cross-platform version? Thanks a lot! joel -- http://mail.python.org/ma