Should I use fork or threads?

Posted by shadyabhi on Stack Overflow See other posts from Stack Overflow or by shadyabhi
Published on 2010-03-20T12:07:21Z Indexed on 2010/03/20 12:11 UTC
Read the original article Hit count: 294

In my script, I have a function foo which basically uses pynotify to notify user about something repeatedly after a time interval say 15 minutes.

def foo:
    while True:
        """Does something"""
        time.sleep(900)

My main script has to interact with user & does all other things so I just cant call the foo() function. directly.

Whats the better way of doing it and why? Using fork or threads?

© Stack Overflow or respective owner

Related posts about python

Related posts about suggestions