Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Locking/unlocking program execution using a queue

by RazorbladeBidet (Friar)
on Mar 31, 2005 at 13:17 UTC ( [id://443794]=note: print w/replies, xml ) Need Help??


in reply to Re: Locking/unlocking program execution using a queue
in thread Locking/unlocking program execution using a queue

I didn't see that documented anywhere (and I have no man pages installed for flock, fcntl or lockf on the AIX machine I am working on!) so I tested it out.

By hand it seemed to work... but running it in a script of
#!/bin/ksh

testlock.pl 1 &
testlock.pl 2 &
testlock.pl 3 &
testlock.pl 4 &
testlock.pl 5 &
gave me this:

got lock 4
finished sleeping 4
got lock 3
finished sleeping 3
got lock 1
finished sleeping 1
got lock 5
finished sleeping 5
got lock 2
finished sleeping 2
So I don't think that's supported on all platforms
--------------
"But what of all those sweet words you spoke in private?"
"Oh that's just what we call pillow talk, baby, that's all."
  • Comment on Re^2: Locking/unlocking program execution using a queue

Replies are listed 'Best First'.
Re^3: Locking/unlocking program execution using a queue
by reasonablekeith (Deacon) on Mar 31, 2005 at 13:44 UTC
    I had only tried it by hand, but it worked fine when I ran it as per your ksh script just now. I'm on Solaris 5.8. Guess it's not something you can rely on though.
      Yes, unfortunately, I'm finding this to be the case no matter what I do. Whatever locking mechanism I choose will have an issue with execution order. I'm currently on the hunt for an execution start time that's more granular than $^T...
      --------------
      "But what of all those sweet words you spoke in private?"
      "Oh that's just what we call pillow talk, baby, that's all."

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-04-23 21:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found