http://www.perlmonks.org?node_id=1012890


in reply to Re^2: problem of my multithreading perl script
in thread problem of my multithreading perl script

Actually it will run slower. All of the threads are writing to the same hash. For each write, the hash is locked and any other threads have to way until the current thread finishes its write before they can start.

Try having each thread write to a separate hash, then merge them in the main thread once the reading is complete.