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 ) { ... }