Re: [Perlunit-devel] Suggestions for a PerlUnit conundrum?
Status: Beta
Brought to you by:
mca1001
From: Matthias F. <mf...@hi...> - 2002-06-22 01:11:26
|
On Fri, 21 Jun 2002, Adam Spiers wrote: > Matthias Ferber (mf...@hi...) wrote: > > Named pipes have all the same problems as message queues, unfortunately. > [snip] > > Difficult to say without seeing the code and understanding more about > how message queues get left behind. Can't you do some cleanup in END? I had to look this up, but unfortunately END doesn't handle the real problem case, which is when the program goes kaput due to a signal, in particular if the user hits ctrl-C. It was a good idea though. I've been reading about perl 5.8 and the new threading model. I have some hopes for that. The part about how message queues get left behind is actually very simple and sort of irrelevant. The concept is exactly the same as if my script creates a temporary file and deletes it when it's finished. If the script is cancelled halfway through, the temporary file doesn't get deleted, and over time these files will eat up space. The difference is that temporary files are so common that people have mechanisms around for dealing with them, and the /tmp directory is a reasonably safe place to put them. There's no such thing for IPC structures, which don't live in the file system. (I also have a suspicion that lingering IPC thingies take up more OS resources, but that's only a guess.) Either way, this is a tough problem for a reusable library -- unless there's some kind of convention I'm unaware of. Sigh... hurry up, threads.... Matthias |