in reply to use dual-core or quad-core

You could use Win32::API to call the SetProcessAffinityMask() api.

I'm not sure if there are any existing modules that allow access to this API.

That said, I'm not at all sure that doing so will achieve anything given your description of what you are seeing. Using 75% of one cpu rather than 25% of three or four is not going to make your process run much more quickly. 1% or 2% at the very best (reduced task switching and increased cache coherency (maybe)).

The best way to speed your application, assuming it is amenable to the possibility, would be to thread it so that it can utilise more than one cpu concurrently. You might be able to cut your run time by 50% or 65% or 75% by using 2, 3, or 4 cpus concurrently; (in theory), but it depends a lot on the nature of your application.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^2: use dual-core or quad-core
by syphilis (Archbishop) on May 21, 2008 at 09:04 UTC
    I'm not sure if there are any existing modules that allow access to this API.

    I think Win32-Process does.

    Cheers,
    Rob