Re: signals (again)

2005-08-11 Thread bill
I found a good solution to this problem in Richard Steven's _Network_Programming_. It seems like everything shows up in Steven's books! Rather than pausing, you do a blocking read on a pipe. You only write to the pipe from within the signal handler. However, this brings up the better question:

Re: signals (again)

2005-08-11 Thread Michael Hudson
"bill" <[EMAIL PROTECTED]> writes: > I see this (or similar) question occasionally looking back through the > archive, but haven't yet seen a definitive answer, so I'm going to ask > it again. > > Consider the following: > > while True: > do_something_to_files_in_directory(fd) > fcntl(fd,

Re: signals (again)

2005-08-10 Thread bill
How does that help? I interpret "use asynchronous calls" to mean "use fcntl to set an FN_NOTIFY on the directory in order to be alerted when something needs to be done." But the method of doing that which I outlined above has a critical section in which the incoming signal will not be noticed.

Re: signals (again)

2005-08-10 Thread Paul Rubin
"bill" <[EMAIL PROTECTED]> writes: > What's the pythonic thing to do here? How can I > guarantee timely response to the creation of a file in the directory > referenced by fd? Use asynchronous calls and/or a separate thread. -- http://mail.python.org/mailman/listinfo/python-list