Just another Perl shrine | |
PerlMonks |
Re^2: Question about flock and printing to fileby jeffenstein (Hermit) |
on Jun 23, 2015 at 17:12 UTC ( [id://1131676]=note: print w/replies, xml ) | Need Help?? |
From the man page of flock(2) on Linux, the file descriptors created by fork(2) are considered to be the same instance, as if you were calling flock on the same file descriptor in the same process. The solution would be to open the file after $pm->start, and close it before $pm->finish, so that flock(2) will consider it as a different file descriptor.
In Section
Seekers of Perl Wisdom
|
|