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


Groups > comp.lang.python > #83826

Re: How to terminate the function that runs every n seconds

From Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject Re: How to terminate the function that runs every n seconds
Date 2015-01-15 09:11 -0500
Organization IISS Elusive Unicorn
References (1 earlier) <CACT3xuUr-07yW-FjiKBjPbsbn5j7r1vUfu1E0A6Myz=7sYpnzA@mail.gmail.com> <54B69A5B.5000801@davea.name> <CACT3xuXSuXyRu8ReXLczFw9N_LEajQzDM=eccdU3GPmj4MgYLA@mail.gmail.com> <mailman.17737.1421283049.18130.python-list@python.org> <87r3uwpetd.fsf@elektro.pacujo.net>
Newsgroups comp.lang.python
Message-ID <mailman.17761.1421331127.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Thu, 15 Jan 2015 11:34:54 +0200, Marko Rauhamaa <marko@pacujo.net>
declaimed the following:

>Dennis Lee Bieber <wlfraed@ix.netcom.com>:
>
>> 	The main thing to consider is that "killing" a thread doesn't
>> work well in Python. Instead the thread has to check for some signal
>> telling it to quit.
>
>Alas, a thread can't check anything because it's blocked by I/O.
>
	My response to that then is: design the thread's I/O so that it is not
blocking... On Linux, maybe a timed select(); Windows? short sleeps around
a non-blocking check for available data... (if console I/O, msvcrt.kbhit();
otherwise may need some other library function to put a time-out on the
I/O)

-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

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


Thread

Re: How to terminate the function that runs every n seconds Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-01-14 19:35 -0500
  Re: How to terminate the function that runs every n seconds Marko Rauhamaa <marko@pacujo.net> - 2015-01-15 11:34 +0200
    Re: How to terminate the function that runs every n seconds Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-01-15 09:11 -0500
      Re: How to terminate the function that runs every n seconds Marko Rauhamaa <marko@pacujo.net> - 2015-01-15 16:15 +0200
        Re: How to terminate the function that runs every n seconds Marko Rauhamaa <marko@pacujo.net> - 2015-01-15 17:29 +0200

csiph-web