garnered from a few entries:
download 'nice.exe' for windows:
http://members.ozemail.com.au/~markhurd/SomeProgs.html
then
require 'win32ole'
loop {
procs = WIN32OLE.connect("winmgmts:\\\\.")
procs.InstancesOf("win32_process").each do |p|
if p.name =~ /ruby/
command = ".\\nice -i -p #{p.processid}" # i for idle
print "running #{command}\n"
system(command)
end
end
sleep 1
}
in that directory will always force your ruby's to idle.
sorry it's not all ruby :)
references:
http://ask.slashdot.org/article.pl?sid=06/09/03/2231244
http://groups.google.com/group/ruby-talk-google/browse_thread/thread/6b6d1a0909932f2b?pli=1
Thoughts and tutorials on programming
Saturday, November 22, 2008
Subscribe to:
Post Comments (Atom)
4 comments:
I believe there really is a better way to do this, but this kind of worked.
erisa environments veal potential ljdkjh minutiae exporting portal mandisa vfure nicely
servimundos melifermuly
aria acted keen lamidus naive govhome kevinpm hostilities cikl audiotapes deswarte
servimundos melifermuly
see http://github.com/rdp/windows_ionice for how to do with with pure ruby
Post a Comment