On Thu, Nov 09, 2000, To [EMAIL PROTECTED] wrote about "Re: number of CPUs":
> On Wed, Nov 08, 2000, Adi Stav wrote about "Re: number of CPUs":
> >...
> > But why is it so crucial not to parse a file? I can't imagine anyone
> > checking for the number of CPUs in the inner loop of their programs :)
> > 
> >   system( "exit `grep ^processor /proc/cpuinfo | tail -1 | cut -d : -f 2`" )
> > 
> > Would probably work (I don't have SMP machine to check it).
> 
> This will obviously not work - unless your intention was to print the number
> of processors on the standard output, rather than actually using it in
> your program :)

Sorry - I was too quick on my reply. What you wrote should in fact work -
I didn't notice the "exit" part. This is not to say that it's a very
efficient method of doing it... And it will not work on machines with over
126 CPUs :)

-- 
Nadav Har'El                        |    Thursday, Nov 9 2000, 11 Heshvan 5761
[EMAIL PROTECTED]             |-----------------------------------------
Phone: +972-53-245868, ICQ 13349191 |Someone offered you a cute little quote
http://nadav.harel.org.il           |for your signature? JUST SAY NO!

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to