on renice
on renice
- Subject: on renice
- From: roy whelden <email@hidden>
- Date: Thu, 17 Oct 2002 17:25:06 -0700
I wonder if there is an anomaly with the Unix command renice on Mac OS
X.
All the OS X Unix documentation says the renice command speeds up
(gives higher priority to) or slows down (gives lower priority to) a
program by assigning it an integer in the range -20 to 20, with -20 the
highest priority, 20 the lowest. Example:
renice -20 666
would accelerate (give highest priority to) the program whose process
id number was 666.
(Sudo should be used with the renice command.)
I've done a bit of research on this and can't convince myself that this
is accurate. (Caveat: I am a Unix novice. If this apparent anomaly is
just an error in my understanding, I apologize.)
I used a little AppleScript Odometer (which I send along) which does
nothing but measure the speed at which it runs by counting the number
of events it sends per second. Assigning this script a priority of -20
using the renice command makes it run at about 76 events per second on
my iMac G3. And yet, unexpectedly, assigning the script a priority of
+20, it runs at more than 4 times that speed (In fact, it sent more
than 535 events per second.)
I have tested this numerous times. I have tested other applications
(other than this little script) with corroborating results.
Would it not seem, then, that +20 is indeed the highest priority and
-20 is the lowest, and not the other way around?
I would be interested whether other people could reproduce these
results.
AppleScript Odometer:
delay 90 --allowing me the time to set the renice command
set s to current date
repeat 1000 times
tell application "Finder"
--get the finders name
name
end tell
end repeat
set e to (current date) - s
display dialog "Average speed was " & 1000 / e & " events per second"
Thanks,
Roy Whelden
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.