Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #98675

Re: cross platform alternative for signal.SIGALRM?

Path csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Christian Gollwitzer <auriocus@gmx.de>
Newsgroups comp.lang.python
Subject Re: cross platform alternative for signal.SIGALRM?
Date Thu, 12 Nov 2015 07:43:57 +0100
Organization A noiseless patient Spider
Lines 30
Message-ID <n21cb4$agq$1@dont-email.me> (permalink)
References <n1vpl3$hrl$1@news2.informatik.uni-stuttgart.de> <mailman.251.1447292269.16136.python-list@python.org> <877flnu4kn.fsf@elektro.pacujo.net>
Mime-Version 1.0
Content-Type text/plain; charset=iso-8859-15; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Thu, 12 Nov 2015 06:41:40 -0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="09360e0ab07672f4bcf79b9f96c5414e"; logging-data="10778"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Z2A3Vpo8OUNyJXX9rqZ21CPUyU4nHzZA="
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:38.0) Gecko/20100101 Thunderbird/38.3.0
In-Reply-To <877flnu4kn.fsf@elektro.pacujo.net>
Cancel-Lock sha1:y92SwNWM7Xr610tLQY4h+ipxTMs=
Xref csiph.com comp.lang.python:98675

Show key headers only | View raw


Am 12.11.15 um 07:14 schrieb Marko Rauhamaa:
> Terry Reedy <tjreedy@udel.edu>:
>
>> The cross-platform 3.4 asyncio module has some functions with
>> timeouts.
>
> Even that doesn't forcefully interrupt an obnoxious blocking function
> call like
>
>     time.sleep(10000)

A blocking call - granted. But what happens in a blocking loop, i.e.

for i in range(10000000000000000000000000):
	pass

?

My understanding of async is that it creates an event loop. In which 
case the loop has no chance to run within a block of code that computes 
anything, is that correct? Or does it hook into the interpreter and is 
able to interrupt the program between bytecodes?

> I'm thinking the only portable way is to run a watchdog process with
> subprocess or multiprocessing.

What about a thread which calls exit() after the timeout? Does that 
forcefully kill the whole process?

	Christian

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

cross platform alternative for signal.SIGALRM? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2015-11-11 16:16 +0000
  Re: cross platform alternative for signal.SIGALRM? Marko Rauhamaa <marko@pacujo.net> - 2015-11-11 18:30 +0200
    Re: cross platform alternative for signal.SIGALRM? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2015-11-11 17:06 +0000
      Re: cross platform alternative for signal.SIGALRM? Marko Rauhamaa <marko@pacujo.net> - 2015-11-11 20:03 +0200
        Re: cross platform alternative for signal.SIGALRM? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2015-11-11 22:42 +0000
      Re: cross platform alternative for signal.SIGALRM? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-11-11 19:42 -0500
  Re: cross platform alternative for signal.SIGALRM? Terry Reedy <tjreedy@udel.edu> - 2015-11-11 20:37 -0500
    Re: cross platform alternative for signal.SIGALRM? Marko Rauhamaa <marko@pacujo.net> - 2015-11-12 08:14 +0200
      Re: cross platform alternative for signal.SIGALRM? Christian Gollwitzer <auriocus@gmx.de> - 2015-11-12 07:43 +0100
        Re: cross platform alternative for signal.SIGALRM? Chris Angelico <rosuav@gmail.com> - 2015-11-12 18:37 +1100
        Re: cross platform alternative for signal.SIGALRM? Terry Reedy <tjreedy@udel.edu> - 2015-11-12 05:15 -0500
        Re: cross platform alternative for signal.SIGALRM? Chris Angelico <rosuav@gmail.com> - 2015-11-12 22:38 +1100
        Re: cross platform alternative for signal.SIGALRM? Terry Reedy <tjreedy@udel.edu> - 2015-11-12 09:01 -0500
      Re: cross platform alternative for signal.SIGALRM? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2015-11-12 07:22 +0000
        Re: cross platform alternative for signal.SIGALRM? Marko Rauhamaa <marko@pacujo.net> - 2015-11-12 10:15 +0200
    Re: cross platform alternative for signal.SIGALRM? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2015-11-12 06:58 +0000
  Re: cross platform alternative for signal.SIGALRM? Cameron Simpson <cs@zip.com.au> - 2015-11-12 16:20 +1100

csiph-web