Re: SMP question ?

2000-09-10 Thread Mike A. Harris
On Fri, 8 Sep 2000, John Summerfield wrote: >The whole idea of naming a numeric datatype "int" was a pretty poor idea. >"long int" etc are little better. I prefer PL/1's fixed bin(31) - one defines >the sice of the fixed-point number (31 bits plus sign) and representation >(binary). It also al

Re: SMP question ?

2000-09-08 Thread John Summerfield
> > I'll bet there are more as well. There are also architectures > that arrange the bit order inside the bytes differently for what > it is worth. I know Intel NAMES them back-to-front. I started out in a simple world: Memory locations numbered (as one might view them) left to right. Bytes|c

Re: SMP question ?

2000-09-08 Thread John Summerfield
> On Thu, 7 Sep 2000, John Summerfield wrote: > > >> >int main(void) > >> >{ > >> >printf("%ld CPUs online\n", sysconf(_SC_NPROCESSORS_ONLN)); > ^^^ > > >[root@dugite /root]# man getconf > >No manual entry for getconf > >[root@dugite /root]# getconf _N

Re: SMP question ?

2000-09-07 Thread Mike A. Harris
On Thu, 7 Sep 2000, John Summerfield wrote: >> >int main(void) >> >{ >> >printf("%ld CPUs online\n", sysconf(_SC_NPROCESSORS_ONLN)); ^^^ >[root@dugite /root]# man getconf >No manual entry for getconf >[root@dugite /root]# getconf _NPROCESSORS_ONLN >1 >

Re: SMP question ?

2000-09-07 Thread Mike A. Harris
On Thu, 7 Sep 2000, John Summerfield wrote: >> Uh, you realize that for some architectures it isn't 1-2-3-4 if you >> store 0x01020304 into a double-word. It might be 2-1-4-3 o >> something else perverse. > >In 30 years, I've only seen two orders of arranging bytes in ints. > >There other repres

Re: SMP question ?

2000-09-06 Thread Norman Levin
gt; From: "Derek Tattersall" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, September 04, 2000 12:27 PM > Subject: Re: SMP question ? > > > * Mikael Aronsson ([EMAIL PROTECTED]) [000904 03:16]: > > > > > > Hi ! > > > &g

Re: SMP question ?

2000-09-06 Thread John Summerfield
> > - Original Message - > From: John Summerfield <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, September 05, 2000 16:39 > Subject: Re: SMP question ? > > > > > > > > > > This sort of thing is inherently a no

Re: SMP question ?

2000-09-06 Thread John Summerfield
> On Tue, 5 Sep 2000, Matt Wilson wrote: > > >#include > > > >int main(void) > >{ > >printf("%ld CPUs online\n", sysconf(_SC_NPROCESSORS_ONLN)); > >return 0; > >} > > > >from shell: > > > >$ getconf _NPROCESSORS_ONLN > > Drat! That is one thing that bugs me about Linux... You hunt > a

Re: SMP question ?

2000-09-05 Thread Julie
From: Mike A. Harris <[EMAIL PROTECTED]> > On Wed, 6 Sep 2000, John Summerfield wrote: > > >> This sort of thing is inherently a non-portable problem like > >> detecting endianness and other such things. It is unlikely any > > > >Detecting endianness isn't hard to do portably. I did it about 20 y

Re: SMP question ?

2000-09-05 Thread Mike A. Harris
On Wed, 6 Sep 2000, John Summerfield wrote: >> This sort of thing is inherently a non-portable problem like >> detecting endianness and other such things. It is unlikely any > >Detecting endianness isn't hard to do portably. I did it about 20 years ago, >in COBOL, when coding for a Honeywell mi

Re: SMP question ?

2000-09-05 Thread Mike A. Harris
On Tue, 5 Sep 2000, Matt Wilson wrote: >#include > >int main(void) >{ >printf("%ld CPUs online\n", sysconf(_SC_NPROCESSORS_ONLN)); >return 0; >} > >from shell: > >$ getconf _NPROCESSORS_ONLN Drat! That is one thing that bugs me about Linux... You hunt around looking for the wheel, and

Re: SMP question ?

2000-09-05 Thread Chris Abbey
At 05:39 9/6/00 +0800, John Summerfield wrote: > > This sort of thing is inherently a non-portable problem like > > detecting endianness and other such things. It is unlikely any > >Detecting endianness isn't hard to do portably. I did it about 20 years ago, >in COBOL, when coding for a Honeywell

Re: SMP question ?

2000-09-05 Thread Julie
- Original Message - From: John Summerfield <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, September 05, 2000 16:39 Subject: Re: SMP question ? > > > > > This sort of thing is inherently a non-portable problem like > > detecting endiann

Re: SMP question ?

2000-09-05 Thread John Summerfield
> > This sort of thing is inherently a non-portable problem like > detecting endianness and other such things. It is unlikely any Detecting endianness isn't hard to do portably. I did it about 20 years ago, in COBOL, when coding for a Honeywell mini. The owners didn't know whether it was beg

Re: SMP question ?

2000-09-05 Thread Matt Wilson
from C: #include int main(void) { printf("%ld CPUs online\n", sysconf(_SC_NPROCESSORS_ONLN)); return 0; } from shell: $ getconf _NPROCESSORS_ONLN Cheers, Matt On Mon, Sep 04, 2000 at 09:08:25AM +0100, Mikael Aronsson wrote: > Hi ! > > What is the best way to detect the number of C

RE: SMP question ?

2000-09-05 Thread Martin Waller
LE end machine */ } Martin -Original Message- From: Mike A. Harris [mailto:[EMAIL PROTECTED]] Sent: 05 September 2000 09:03 To: [EMAIL PROTECTED] Subject: Re: SMP question ? On Mon, 4 Sep 2000, Mikael Aronsson wrote: >Yes I know, but what I was looking for was a portable system ca

Re: SMP question ?

2000-09-05 Thread Mike A. Harris
On Mon, 4 Sep 2000, Mikael Aronsson wrote: >Yes I know, but what I was looking for was a portable system call that could >be used from inside an application to detect the number of CPU's, how about >other UNIX systems, do they have a proc/cpuinfo to ? This sort of thing is inherently a non-porta

Re: SMP question ?

2000-09-05 Thread Mike A. Harris
On Mon, 4 Sep 2000, Mikael Aronsson wrote: >What is the best way to detect the number of CPU's ?, I guess I >could look in /proc/cpuinfo, but is there a better more >portable way to do it ? I don't believe so. /proc/cpuinfo is there for that purpose. It'd be nice if Linux got a binary interfa

Re: SMP question ?

2000-09-05 Thread Mike A. Harris
On Mon, 4 Sep 2000, Derek Tattersall wrote: >Date: Mon, 4 Sep 2000 07:27:38 -0400 >From: Derek Tattersall <[EMAIL PROTECTED]> >To: [EMAIL PROTECTED] >Content-Type: text/plain; charset=us-ascii >Subject: Re: SMP question ? > >* Mikael Aronsson ([EMAIL PROTECTED]

Re: SMP question ?

2000-09-04 Thread Venkatesh Krishnamurthi
Hi, > Yes I know, but what I was looking for was a portable system call that could > be used from inside an application to detect the number of CPU's, how about > other UNIX systems, do they have a proc/cpuinfo to ? As far as I can see, Solaris (SunOS 5.5) does not have a /proc/cpuinfo. The "p

Re: SMP question ?

2000-09-04 Thread Mikael Aronsson
AIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, September 04, 2000 12:27 PM Subject: Re: SMP question ? > * Mikael Aronsson ([EMAIL PROTECTED]) [000904 03:16]: > > > > Hi ! > > > > What is the best way to detect the number of CPU's ?, I guess I could

Re: SMP question ?

2000-09-04 Thread Derek Tattersall
* Mikael Aronsson ([EMAIL PROTECTED]) [000904 03:16]: > > Hi ! > > What is the best way to detect the number of CPU's ?, I guess I could look in >/proc/cpuinfo, but is there a better more portable way to do it ? > > Mikael > grep -c "processor" /proc/cpuinfo gives the number of processors. -

SMP question ?

2000-09-04 Thread Mikael Aronsson
Hi !   What is the best way to detect the number of CPU's ?, I guess I could look in /proc/cpuinfo, but is there a better more portable way to do it ?   Mikael