in reply to Re: Fork + Flock = Who Gets the Lock?
in thread Fork + Flock = Who Gets the Lock?

Thanks! So if they share the lock, then would it be safe to say that if the child process closes the file handle then it will no longer have a lock, but the parent will?
  • Comment on Re^2: Fork + Flock = Who Gets the Lock?

Replies are listed 'Best First'.
Re^3: Fork + Flock = Who Gets the Lock?
by ikegami (Patriarch) on Jun 03, 2005 at 20:01 UTC
    yes, the lock being released only "when all such descriptors have been closed" (in the absense of an explicit unlock) means exactly that.
Re^3: Fork + Flock = Who Gets the Lock?
by salva (Canon) on Jun 03, 2005 at 20:01 UTC
    yes!

    BTW, I think this behaviour is very OS dependant

      Yes! here too - veeery useful insight there :)