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

Re^3: Fast provider feeding slow consumer

by NetWallah (Canon)
on Apr 25, 2016 at 18:29 UTC ( [id://1161473]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Fast provider feeding slow consumer
in thread Fast provider feeding slow consumer

The error appears to occur due to the fact that the code uses "DBI" both as an ENUM and a module name. Try changing these 2 lines:
use enum qw[ IN DBI_ENUM ]; # *CHANGED* my @Qs = map Thread::Queue->new(), 1 .. 2; # set up two Qs ... ## start 10 walkers # *CHANGED* next line my @walkers = map{ threads->create( \&walker, @Qs[ IN, DBI_ENUM ] ) } +1 .. $T; ##

        This is not an optical illusion, it just looks like one.

Replies are listed 'Best First'.
Re^4: Fast provider feeding slow consumer
by marioroy (Prior) on Apr 26, 2016 at 03:10 UTC

    Ditto for line # 70. Thank you NetWallah.

    ## process data produced by walkers while( $Qs[ DBI_ENUM ]->dequeue ) { ... }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-16 14:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found