Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: getting more resource from perl

by ikegami (Patriarch)
on Nov 09, 2005 at 16:14 UTC ( #507119=note: print w/replies, xml ) Need Help??

in reply to getting more resource from perl

You may want to search for "priority" and "nice". Those are both related terms. I cam accross these two solutions:

For some/many unixes, Proc::ProcessTable::Process provides the method priority.

For Windows,

use Win32::Process; my $obj; Win32::Process::Open($obj, $$, 0); $obj->SetPriorityClass(HIGH_PRIORITY_CLASS);

By the way, trying to get *more* CPU is not likely to make your script execute faster on a desktop system (if that's what you have). Desktop systems tend to be idle almost all the time, so there's no CPU time to steal from other applications. Needing more CPU is usually a sign of inefficient code and/or of a need of better hardware. All too often the former.

Update: Searched and found a unix and Windows module. Updated the node accordingly.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://507119]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2022-05-25 13:27 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (90 votes). Check out past polls.