in reply to For all your forking needs..
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE (tilly) 2: For all your forking needs..
by tilly (Archbishop) on Oct 13, 2000 at 01:03 UTC | |
Perl developers have an official way to communicate what is and is not deprecated. That way is to put the deprecation into the documentation, and warnings. Were wait deprecated I would expect to see this fact documented on my machine in perldiag and where-ever else it appears. Which in this case would be perlfaq8, perlfunc, perlipc, perlport, perltoc, perlvar. The only warning is in perlport where it says that wait is not implemented on MacOS and VOS. For a contrast, compare to $[ which really is deprecated. Looking for $[ in the documentation I find it in perldata (says deprecated), perldiag (says deprecated), perlembed (comment by line that breaks it), perlfaq4 (accidental match), perlport (accidental match), perltoc (part of a long list), and perlvar (says its use is discouraged). An incidental note, respected books such as the Cookbook use wait liberally. If it is truly deprecated, then that is news to the people who maintain Perl! All of which is a long way to say that I am one of the -- votes on your node, and I am for a good reason. Because you are giving wrong advice. | [reply] |
by AgentM (Curate) on Oct 13, 2000 at 05:05 UTC | |
AgentM Systems or Nasca Enterprises is not responsible for the comments made by AgentM- anywhere. | [reply] |
by tilly (Archbishop) on Oct 13, 2000 at 06:20 UTC | |
First of all if you look at Run commands in parallel you will see a use of wait that I would support. Now let us get at the misunderstanding. What you are quoting Stevens talking about is handling SIGCHILD signals. He is very much correct that you should not do that with wait. The right way to be careful is with waitpid. And indeed the problem is particularly bad in Perl. I agree with all that. But that is very different from saying that wait itself should be deprecated. Go back to the example I gave you. You see there that it is used carefully. Signals are not being used to track children, rather you are carefully launching children, keeping track of them, and matching children to reaped processes. So what if you block? The desired behaviour is to block! But, you say, we should just use a signal handler, right? Wrong. Perl's signal handling is not very good. First of all while a signal is being handled, if you get a second one you can dump core. Oops. There are various times in normal operation when a signal can cause you to dump core. Double oops. And Perl's signal handling is based on SysV semantics - not BSD or POSIX. So even while I agree with everything that Stevens wrote, it is irrelevant since I don't trust signals in Perl. When you don't trust signals then you have to step back and ask yourself, "Do I really want to block?" And if you do, then wait is probably just fine and dandy. When you are talking about signal handlers, it is not good. But for its little niche it is fine. Now if you disagree with anything I just said, saying it here is the wrong thing to do. Instead get the current development version of Perl, download it, go into the documentation, and start submitting patches to p5p. | [reply] |
by AgentM (Curate) on Oct 13, 2000 at 06:55 UTC | |
by tilly (Archbishop) on Oct 13, 2000 at 09:08 UTC | |
| |
|
RE: RE: For all your forking needs..
by myocom (Deacon) on Oct 13, 2000 at 00:06 UTC | |
Disclaimer: I don't use forking, and I'm using 5.005. Just out of curiosity, where do you get that wait() is "well-deprecated"? Seems to me that if I were to throw out docs that mentioned it, I'd have to delete perlfunc. If it were deprecated (again, at least in 5.005), I'd expect -w to throw a warning... Can you provide a reference? Seems to me that if I were to use forking on 5.005, there'd be no way I'd know it was "well deprecated" and a "nono" until you patronizingly cleared your throat at me. | [reply] [d/l] |