Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: [threads] Open a file in one thread and allow others to write to it

by zentara (Archbishop)
on Nov 16, 2009 at 13:18 UTC ( [id://807445]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    use warnings; 
    ...
    printf "%d:%s", threads->self->tid, $_ while defined( $_ = <$fh> );
    close $fh;
    }
    
  2. or download this
    ========
    zentara wrote:
    ...
    $q->enqueue($fh->fileno());
    sleep 1;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://807445]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2024-03-28 18:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found