Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: singleton lock not reliable

by ikegami (Patriarch)
on Jun 24, 2021 at 04:24 UTC ( #11134239=note: print w/replies, xml ) Need Help??


in reply to Re: singleton lock not reliable
in thread singleton lock not reliable

I am no expert on file locking but I don't think that's possible.

It is.

$ touch lock $ perl -M5.010 -MFcntl=LOCK_EX -e' open(my $fh, "<", "lock") or die $!; flock($fh, LOCK_EX) or die $!; say "ok"; ' ok

flock locks have nothing to do with reading and writing, and they prevent neither. They merely prevent locks from being obtained.

Seeking work! You can reach me at ikegami@adaelis.com

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11134239]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2022-08-14 10:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?