develooper Front page | perl.perl5.porters | Postings from October 1999

[ID 19991004.001] flock with dual processor fails

Thread Previous
October 4, 1999 07:46
[ID 19991004.001] flock with dual processor fails
Message ID:

This is a bug report for perl from,
generated with the help of perlbug 1.26 running under perl 5.00502.

[Please enter your report here]

I just came across an interesting but.  Neither myself, anyone I know, or
the perl clinic can figure this one out.

We have multiple copies of the same program that lock and read the input
from a named pipe (FIFO).  This works GREAT with a single processor.  When
we try with more than one processor then more than one program can flock
the pipe at the same time creating a real mess.  It looks as if perl
internally is using one form of file locking that is not absolute.

below is a summary of the logic used.

use Fcntl ':flock';
flock(PIPE, LOCK_EX);
while(sysread(PIPE, $ch, 1) != 0 && $ch ne "\n") {
	$line .= $ch;
flock(PIPE, LOCK_UN);


-Noah Silverman

[Please do not change anything below this line]

Site configuration information for perl 5.00502:

Configured by joshg at Wed May  5 10:45:20 EDT 1999.

Summary of my perl5 (5.0 patchlevel 5 subversion 2) configuration:
    osname=solaris, osvers=2.6, archname=sun4-solaris
    uname='sunos 5.6 generic_105181-11 sun4m sparc sunw,sparcstation-20 '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
    cc='cc', optimize='-O', gccversion=2.8.1
    ccflags ='-I/usr/local/include'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldb -ldl -lm -lc -lcrypt
    libc=/lib/, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'

Locally applied patches:

@INC for perl 5.00502:

Environment for perl 5.00502:
    LANG (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About