Perl how to make the 2nd CPU full?

Hi Buddies,

my pc has two CPU, so CPU1 and CPU2.
I have a perl "a.pl", when i "./a.pl", i can see the CPU1 is full or CPU2 is full, mean only one is full, another one is idle.

Wonderring what shall i do in order to let both CPU to process this a.pl.:frowning:

Thanks

Use threads or fork into 2 processes each doing a part of the load. Both approaches will require you to somehow synchronize the workers (esp. any resources they access)