Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

flock() broken under FreeBSD?

by tye (Sage)
on Jul 26, 2002 at 23:47 UTC ( #185697=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ perl -MConfig -le 'print $Config{d_flock}'
    define
    
  2. or download this
    $ ./locktest & sleep 4; ./locktest
    [1] 64228
    Using flock()...
    ...
    64233 owns
    64233 shares
    ^C
    
  3. or download this
    $ ./locktest & sleep 4; ./locktest
    [1] 64308
    Using flock()...
    ...
    64308 shares
    ^C
    $ kill %1
    
  4. or download this
    64310 shares.
    64310 waiting for previous instance(s) to exit...
    64308 owns
    
  5. or download this
    $ ./locktest 1 & sleep 4; ./locktest 1
    [1] 64442
    Using fcntl() locks...
    ...
    64446 owns
    64446 shares
    ^C
    
  6. or download this
    $ ( sleep 1; ./locktest 1 ) & sleep 8; ./locktest 1
    [1] 64887
    Using fcntl() locks...
    ...
    64891 can't lock self: Resource temporarily unavailable
    64890 shares
    $ kill %1
    
  7. or download this
    #!/usr/bin/perl -w
    #
    
    ...
        sleep $config{delay};
    }
    __END__
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://185697]
Approved by dws
Front-paged by footpad
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2017-04-24 08:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (437 votes). Check out past polls.