12 Nov 2002 itamar   » (Master)

Exceptions in signal handlers

I realized the issue isn't just with exceptions - it can be with any operation (e.g. log rotation on a signal might be interrupting a log write method, and who knows what happens then).

Yet another benefit of event loops is that the problem is easier to solve. Instead of raising an exception (or rotating the log or whatever), you do this by registering a method to run in the next iteration of the event loop. Because you are forced to split up your tasks into small, self-contained, short running event handlers anyway, your program by design will be much easier to structure so that this is not a problem. So, instead of rotating log on signal, you would tell event loop to run log rotation method in its next iteration.

I'm going to have to change Twisted's rotate-log-on-signal code and possibly other signal handlers so they work that way, if they don't already.

Software Methodology

My father wrote a paper on software methodologies which might be of interest to people here, especially if you're interesting in agile programming and the like.

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!