sleep?

Andrae Muys amuys at shortech.com.au
Thu Jan 24 19:58:42 EST 2002


Laura Creighton <lac at strakt.com> wrote in message news:<mailman.1011889238.20407.python-list at python.org>...
> > MaximilianScherr
> > I forgot:
> > 
> > i would like to just use the thread module.
> > 
> 
> You have some good reason to not use threading instead? 
> That is what it is there for.  But I haven't been following the
> discussion.
> 
I would suggest the order-magnitude increase in complexity you face as
soon as you introduce multiple threads into a process is a pretty good
reason to avoid threading if there is a reasonable alternative.

For something as simple as a delayed function call, SIGALARM is clean,
adequate, and far safer then a threaded solution.

One question worth asking, which hasn't been asked so far, is the
nature of your application?  If it has an event-loop (ie. pretty much
any GUI app), most event-loop implementations allow you to register
delayed function calls.

Andrae Muys



More information about the Python-list mailing list