Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: How can I limit the number of Cores in multi-process programming

by SuicideJunkie (Vicar)
on Nov 17, 2015 at 14:09 UTC ( #1147922=note: print w/replies, xml ) Need Help??


in reply to Re^2: How can I limit the number of Cores in multi-process programming
in thread How can I limit the number of Cores in multi-process programming

It sounds strange that you want to multithread for more speed, but then turn around and want to use less CPU % (so it takes longer again?).

Do you have busy loops wasting CPU cycles or something? If so, use a sleep or a select(undef,undef,undef,0.01 to reduce the polling rate and drop the CPU usage to <1%.

You can try a nap of a few milliseconds per iteration on your big long running loops as well if they're hogging resources, but if the loop is doing productive things, letting it finish is usually a good idea ;).

  • Comment on Re^3: How can I limit the number of Cores in multi-process programming
  • Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2022-12-10 09:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?