in reply to Re: flock LOCK_EX
in thread flock LOCK_EX

I don't understand your 2nd sentence. Which never learns of what, and does that make "some code" run simultaneously by both instances? Thanks.