Re: [lazarus] Question: Multiprocessor Systems

2007-03-02 Thread Graeme Geldenhuys

On 3/2/07, tanila [EMAIL PROTECTED] wrote:


I would like to make experiences with multithreadded application and how
to get benefits with more than one cpu.


All you should need to do is create multiple threads in your system
and the OS and CPU(s) will handle the rest.  No need to do something
special in you application.


Another question:
Are this magic doual/quad-core cups real multiprocessor-systems like a
mainboard with two or more processors ?


Yes they are like the old style mainboards with two or more physical
processors on the motherboard.  HyperThreading on the other hand is a
Intel sales gimic which fakes a second processor (software processor).


--
Graeme Geldenhuys

There's no place like S34° 03.168'  E018° 49.342'

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Question: Multiprocessor Systems

2007-03-02 Thread tanila
Great thanks.
Sorry for this many tipos... I didn´t sleep enough this night, I think.

tanila

Am Freitag, den 02.03.2007, 11:20 +0200 schrieb Graeme Geldenhuys:
 On 3/2/07, tanila [EMAIL PROTECTED] wrote:
 
  I would like to make experiences with multithreadded application and how
  to get benefits with more than one cpu.
 
 All you should need to do is create multiple threads in your system
 and the OS and CPU(s) will handle the rest.  No need to do something
 special in you application.
 
  Another question:
  Are this magic doual/quad-core cups real multiprocessor-systems like a
  mainboard with two or more processors ?
 
 Yes they are like the old style mainboards with two or more physical
 processors on the motherboard.  HyperThreading on the other hand is a
 Intel sales gimic which fakes a second processor (software processor).
 
 

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Question: Multiprocessor Systems

2007-03-02 Thread Siegfried Göricke
The easiest way under Linux to get some information about the processors is to 
read the file /proc/cpuinfo. For each also virtual processor you find a 
entry. Here the output of my system(Dual xenon4 with hyperthreading).
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 15
model   : 2
model name  : Intel(R) Xeon(TM) CPU 2.80GHz
stepping: 7
cpu MHz : 2799.603
cache size  : 512 KB
physical id : 0
siblings: 2
core id : 0
cpu cores   : 1
fdiv_bug: no
hlt_bug : no
f00f_bug: no
coma_bug: no
fpu : yes
fpu_exception   : yes
cpuid level : 2
wp  : yes
flags   : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca 
cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid xtpr
bogomips: 5606.67

processor   : 1
vendor_id   : GenuineIntel
cpu family  : 15
model   : 2
model name  : Intel(R) Xeon(TM) CPU 2.80GHz
stepping: 7
cpu MHz : 2799.603
cache size  : 512 KB
physical id : 3
siblings: 2
core id : 0
cpu cores   : 1
fdiv_bug: no
hlt_bug : no
f00f_bug: no
coma_bug: no
fpu : yes
fpu_exception   : yes
cpuid level : 2
wp  : yes
flags   : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca 
cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid xtpr
bogomips: 5598.98

processor   : 2
vendor_id   : GenuineIntel
cpu family  : 15
model   : 2
model name  : Intel(R) Xeon(TM) CPU 2.80GHz
stepping: 7
cpu MHz : 2799.603
cache size  : 512 KB
physical id : 0
siblings: 2
core id : 0
cpu cores   : 1
fdiv_bug: no
hlt_bug : no
f00f_bug: no
coma_bug: no
fpu : yes
fpu_exception   : yes
cpuid level : 2
wp  : yes
flags   : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca 
cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid xtpr
bogomips: 5598.77

processor   : 3
vendor_id   : GenuineIntel
cpu family  : 15
model   : 2
model name  : Intel(R) Xeon(TM) CPU 2.80GHz
stepping: 7
cpu MHz : 2799.603
cache size  : 512 KB
physical id : 3
siblings: 2
core id : 0
cpu cores   : 1
fdiv_bug: no
hlt_bug : no
f00f_bug: no
coma_bug: no
fpu : yes
fpu_exception   : yes
cpuid level : 2
wp  : yes
flags   : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca 
cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid xtpr
bogomips: 5598.85


Am Freitag, 2. März 2007 11:18 schrieb tanila:
 I would like to know how many processors are on the system, because i
 would like to use them paralell for a single task.

 The job could be done using 2, 4, etc threads simultaniously, to speed
 it up with usage of all processors at the same time.

 To split up the task I have to know how many cpus are available for
 usage.

 Is there a way to figure this out ?

 greetings
 tanila

 Am Freitag, den 02.03.2007, 11:20 +0200 schrieb Graeme Geldenhuys:
  On 3/2/07, tanila [EMAIL PROTECTED] wrote:
   I would like to make experiences with multithreadded application and
   how to get benefits with more than one cpu.
 
  All you should need to do is create multiple threads in your system
  and the OS and CPU(s) will handle the rest.  No need to do something
  special in you application.
 
   Another question:
   Are this magic doual/quad-core cups real multiprocessor-systems like a
   mainboard with two or more processors ?
 
  Yes they are like the old style mainboards with two or more physical
  processors on the motherboard.  HyperThreading on the other hand is a
  Intel sales gimic which fakes a second processor (software processor).

 _
  To unsubscribe: mail [EMAIL PROTECTED] with
 unsubscribe as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives

-- 
Best Regards/Gruss Siggi


pgp9ue42CYah4.pgp
Description: PGP signature


Re: [lazarus] Question: Multiprocessor Systems

2007-03-02 Thread Albert Zeyer
I don't know if there is any possibility to define the CPU, on which a
special thread should run on. Is there any?

Because usually, this is something your OS should handle because it
knows best about all the other parallel processes. And it's perhaps not
always the best solution for your application to split all your threads
on perhaps the 4 CPUs of a quadcore, if there is another application
which also needs lot of CPU power (I would thought, that in this case,
it should be a lot faster, if your application uses 2 CPUs and the other
application the other ones). But as I said, usually this is something
your OS should take care about.

Greetings,
Albert


Am Freitag, den 02.03.2007, 11:18 +0100 schrieb tanila:

 I would like to know how many processors are on the system, because i
 would like to use them paralell for a single task.
 
 The job could be done using 2, 4, etc threads simultaniously, to speed
 it up with usage of all processors at the same time.
 
 To split up the task I have to know how many cpus are available for
 usage.
 
 Is there a way to figure this out ?
 
 greetings
 tanila
 
 Am Freitag, den 02.03.2007, 11:20 +0200 schrieb Graeme Geldenhuys:
  On 3/2/07, tanila [EMAIL PROTECTED] wrote:
  
   I would like to make experiences with multithreadded application and how
   to get benefits with more than one cpu.
  
  All you should need to do is create multiple threads in your system
  and the OS and CPU(s) will handle the rest.  No need to do something
  special in you application.
  
   Another question:
   Are this magic doual/quad-core cups real multiprocessor-systems like a
   mainboard with two or more processors ?
  
  Yes they are like the old style mainboards with two or more physical
  processors on the motherboard.  HyperThreading on the other hand is a
  Intel sales gimic which fakes a second processor (software processor).
  
  
 
 _
  To unsubscribe: mail [EMAIL PROTECTED] with
 unsubscribe as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
 


Re: [lazarus] Question: Multiprocessor Systems

2007-03-02 Thread Siegfried Göricke
Am Freitag, 2. März 2007 14:19 schrieb Albert Zeyer:
 I don't know if there is any possibility to define the CPU, on which a
 special thread should run on. Is there any?

This is little bit more difficult.

on windows you can set the cpu affinity mask with windowsapi calls
getProcessAffinityMask()
setProcessAffinityMask()
getThreadAffinityMask()
setThreadAffinityMask()
=

on linux you can set this mask with glibc calls 
=
/* Set the CPU affinity for a task */
extern int sched_setaffinity (pid_t pid, size_t cpusetsize,
  const cpu_set_t *cpuset);

/* Get the CPU affinity for a task */ extern int sched_getaffinity (pid_t pid, 
size_t cpusetsize, cpu_set_t *cpuset);
=

I think that this calls not covered in the fpc rtl, so the only way to use it 
convert the header files as described in the fpc documentation. (has anybody 
done this?) 

 Because usually, this is something your OS should handle because it
 knows best about all the other parallel processes. And it's perhaps not
 always the best solution for your application to split all your threads
 on perhaps the 4 CPUs of a quadcore, if there is another application
 which also needs lot of CPU power (I would thought, that in this case,
 it should be a lot faster, if your application uses 2 CPUs and the other
 application the other ones). But as I said, usually this is something
 your OS should take care about.

 Greetings,
 Albert

 Am Freitag, den 02.03.2007, 11:18 +0100 schrieb tanila:
  I would like to know how many processors are on the system, because i
  would like to use them paralell for a single task.
 
  The job could be done using 2, 4, etc threads simultaniously, to speed
  it up with usage of all processors at the same time.
 
  To split up the task I have to know how many cpus are available for
  usage.
 
  Is there a way to figure this out ?
 
  greetings
  tanila
 
  Am Freitag, den 02.03.2007, 11:20 +0200 schrieb Graeme Geldenhuys:
   On 3/2/07, tanila [EMAIL PROTECTED] wrote:
I would like to make experiences with multithreadded application and
how to get benefits with more than one cpu.
  
   All you should need to do is create multiple threads in your system
   and the OS and CPU(s) will handle the rest.  No need to do something
   special in you application.
  
Another question:
Are this magic doual/quad-core cups real multiprocessor-systems like
a mainboard with two or more processors ?
  
   Yes they are like the old style mainboards with two or more physical
   processors on the motherboard.  HyperThreading on the other hand is a
   Intel sales gimic which fakes a second processor (software processor).
 
  _
   To unsubscribe: mail [EMAIL PROTECTED] with
  unsubscribe as the Subject
 archives at http://www.lazarus.freepascal.org/mailarchives

-- 
Best Regards/Gruss Siggi


pgpZuUN4OtNle.pgp
Description: PGP signature