Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-02

Number of CPU threads

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Kjow

Hi all!

Is it possible to determine the number of CPU threads available on an OS (Win, Linux, OSX: so cross platform way) with Lazarus/FPC? (e.g. A dual core = 2 threads, a Core i7 = 8 threads, etc)

Thanks!
Kjow

Reply by email

ik
to Kjow

On linux you can read the /proc/cpuinfo file. In Windows you have some API commands for that (I do not know what they are).
I'm not sure about MacOSX

Ido

LINESIP - Opening the source for communication
http://www.linesip.com
http://www.linesip.co.il

Kjow wrote 15 lines
Hi all! Is it possible to determine the number of CPU threads available on an OS (Win, Linux, OSX: so cross platform way) with Lazarus/FPC? (e.g. A dual core = 2 threads, a Core i7 = 8 threads, etc) Thanks! Kjow -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110224/98d959a7/attachment.html>

Reply by email

Mattias Gaertner
to Kjow: Hi all! Is it possible to determine the number of CPU threads available on an OS (Win,…
Show quoted text 5 lines
Hi all! Is it possible to determine the number of CPU threads available on an OS (Win, Linux, OSX: so cross platform way) with Lazarus/FPC? (e.g. A dual core = 2 threads, a Core i7 = 8 threads, etc)

See the package mtprocs unit mtpcpu for a simple heuristic: http://wiki.lazarus.freepascal.org/Parallel_procedures#Getting_MTProcs

Mattias

Reply by email