I think that any answers will be very OS dependent. Unless the OS provides user-space library functions for processor scheduling, I doubt if perl can provide direct control over processor usage.
Your best bet, IMO, is to use Parallel::ForkManager to fork off a few child processes at a time, each crunching a file. You will get extra time slices at least, on many OS's, and they may get executed on other processors.
If I understand correctly, in Linux SMP the kernel tries to avoid reallocating memory between processors by setting up affinity of a process for the processor that initially got it. Linux's copy-on-write strategy for the child process's environment may stick the children with the parent's affine processor. Ob. warning, my understanding of SMP kernels was never perfect, and is a little out of date.
Your desired optimization may be premature. Most file crunching processes spend most of their time waiting on disk I/O.
After Compline,
Zaxo
In reply to Re: Perl and autoparallelization
by Zaxo
in thread Perl and autoparallelization
by qhayaal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |