Zamky

Honza Pazdziora adelton na informatics.muni.cz
Neděle Duben 16 14:03:12 MEST 2000


On Sat, Apr 15, 2000 at 11:42:49PM +0200, Petr Klimovic wrote:
> Kdyz pouziju flock a v dobe kdy ma soubor zamkly program1 zkousim flock 
> pomoci
> programu2, co se stane? Program2 bude cekat do nekonecna, nebo je tam 
> nejaky
> timeout?

$ man flock(3)
     Requesting a lock on an object that is already  locked  nor-
     mally  causes  the  caller  to  block  until the lock may be
     acquired.  If LOCK_NB is included in  operation,  then  this
     will  not  happen; instead, the call will fail and the error
     EWOULDBLOCK will be returned.

$ perldoc -f flock
             releases a previously requested lock.  If LOCK_NB is
             added to LOCK_SH or LOCK_EX then flock() will return
             immediately rather than blocking waiting for the
             lock (check the return status to see if you got it).

-- 
------------------------------------------------------------------------
 Honza Pazdziora | adelton na fi.muni.cz | http://www.fi.muni.cz/~adelton/
   .project: Perl, DBI, Oracle, MySQL, auth. WWW servers, MTB, Spain.
------------------------------------------------------------------------


Další informace o konferenci Perl