Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2016-08-24 09:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (340 votes). Check out past polls.