in reply to Re: Disappearing File
in thread Disappearing File

Is there a chance for a race condition to occur in my code? Reading and writing of data happens between get_lock() and release_lock(). If this is not sufficient, what is lacking? I just want to understand the problem. Thanks in advance. Gorby

Replies are listed 'Best First'.
Re: Re: Re: Disappearing File
by Zaxo (Archbishop) on Jan 13, 2004 at 03:47 UTC

    Some platforms/perl versions don't support flock. Mod_perl will give you trouble with all those global variables and unlocalized handles - each connection will think it has the lock (I withdraw the "lexical" word). Your locking code will work on the right system under ideal conditions, but there are many things that can fail.

    You haven't shown your error logs and you don't say what platform, perl version, whether threading is in use, or whether different connections have a new environment.

    My advice was to simplify the locking and isolate variables' scope.

    After Compline,
    Zaxo