in reply to Those fork()ing flock()ers...
Another possible option is to open a pipe in the parent process, and fork off a child process that is only responsible for receiving the log. Upon thinking about this though, I guess you might have the same problem with possible co-mingling of lines while printing to the pipe buffer.
So, to optimize your system, keep forked children alive as long as possible, and open the file to be locked first thing.
my @a=qw(random brilliant braindead); print $a[rand(@a)];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Those fork()ing flock()ers...
by ferrency (Deacon) on Dec 05, 2001 at 19:33 UTC |