in reply to Re: Multi-thread combining the results together
in thread Multi-thread combining the results together

Thanks for the input! You, Grandfather and 1nickt have given some ideas to work on.

My single threaded code uses a hash for the output, but I don't need to do that. Each thread can push a ref to Array (a row) onto a common output queue and I can deal with that after everybody is finished. Converting 80K rows to a hash or sorting this is a "no brainer" compared with the time it takes to run the regex.

I wrote the build_regex() function back in 2007 and I'm at the point where what was easily fast enough a decade ago no longer is. I will be rethinking the algorithm, but if I can "juice this baby up by a factor of 3-4", that will give me enough time to ponder a new approach to the problem.

  • Comment on Re^2: Multi-thread combining the results together

Replies are listed 'Best First'.
Re^3: Multi-thread combining the results together
by bliako (Abbot) on Jul 25, 2019 at 11:18 UTC

    Also, I found this very useful Threads From Hell #1: How To Share A Hash [SOLVED].

    This is far-fetched but in case you want to run a server (as a separate script) which provides data to workers (separate single-thread processes) then this can get you started: Re: Disc burning. Good for allowing for DB access and distributing over a cluster - a grand design for sure.