Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^5: threads with shared variables across multiple instances of a module

by BrowserUk (Patriarch)
on Mar 26, 2010 at 16:19 UTC ( [id://831187]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %clients :shared;
    while( my $client = $server->accept;
    ...
    my $fileno = $clients{ client };
    open $client, "+<&$fileno" or die ... ## dup() the the glob from the f
    +ileno
    ## use $client
    
  2. or download this
    while( my $client = $server->accept ) {
        async{
    ...
            }
        }->detach;
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-03-29 01:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found