[Lazarus] Number of CPU threads

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Number of CPU threads

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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
ik
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Number of CPU threads

ik
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




On Thu, Feb 24, 2011 at 23:27, Kjow <[hidden email]> wrote:
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
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Number of CPU threads

Mattias Gaertner
In reply to this post by Kjow
On Thu, 24 Feb 2011 22:27:31 +0100
Kjow <[hidden email]> wrote:

> 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



--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Number of CPU threads

Kjow
2011/2/24 Mattias Gaertner <[hidden email]>:
> See the package mtprocs unit mtpcpu for a simple heuristic:
> http://wiki.lazarus.freepascal.org/Parallel_procedures#Getting_MTProcs
>
> Mattias

Thanks you very much, I will try ASAP. :)

Kjow

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus