10.1, /dev/random, nice numbers

scruffy

Notorious Olive Counter
I have a couple of questions that I am just too impatient to wait the couple of weeks to find out:

a) Is there a /dev/random, or better yet a /dev/urandom?
A real source of random numbers is really a necessity for any sort of encryption, and a big gap in Darwin 1.3.x

b) Does pre-emptive multitasking finally work right, ie. do nice numbers work?
As of 10.0.4 / 1.3.7 you can assign nice numbers to programs, run "nice somecommand", list the nice numbers of processes, but it all has no effect. Two processor-hungry processes with different nice numbers will still get the same amount of cpu power. Pre-emptive multitasking that actually works has just got to be there for OS X to be an OS that "matters" in terms of servers, serious computing, etc.

Thanks to anyone who can resolve my curiosity!
 
urandom exisits now:

crw-r--r-- 1 root wheel 1, 1 Sep 21 15:27 urandom

from my /dev of 10.1

don't have the testing skillz to confirm wheter nice is a-workin.

E
 
It's really good to hear that there is a /dev/urandom. Thanks for checking for me!

If'n you wanted to be super helpful and check whether nice numbers work, you could try something like this:

Get 3 open terminal windows. In one, type:
<tt>yes &gt; /dev/null</tt>
yes is just a program that repetitively spits 'y' out to its output. Don't ask me what the point of it is, here we just use it as a consumer of CPU cycles. We redirect the output to the null device (aka the black hole) to avoid looking at all those silly y's

In the second type:
<tt> nice yes &gt; /dev/null </tt>
This means do the same as above, but with a higher nice number, ie. theoretically at a lower task priority.

In the third, type:
<tt>top -u</tt>
Which will give you a list of all tasks running on the computer, sorted every few seconds by CPU usage.

If the two 'yes' processes are using about the same amount of CPU, then the nice numbers aren't making a difference. If they are using noticeably different amounts then the nice numbers must be doing some good.
 
I gave it a shot:

PID COMMAND %CPU
318 yes 36.1%
319 yes 36.1%

doesn't seem to work. I even tried with nice -20 and nice +20, and the results were still the same.

E
 
Back
Top