[fpc-pascal] CPU affinity of TThread descendants

Michael Van Canneyt michael at freepascal.org
Tue Jan 20 09:07:54 CET 2009

On Mon, 19 Jan 2009, David W Noon wrote:

> Hi,
> I am running FPC 2.3.1 under Linux 2.6.26 on a twin CPU AMD Athlon MP
> system.
> Whenever I instantiate multiple descendants of the TThread class, they
> all seem to run on the same CPU, which is the same CPU as the parent
> thread is running on. With 21 threads in the program, the system monitor
> shows one CPU at 100% busy and the other CPU idle.
> Does this class, by default, impose CPU affinity, in the manner of the
> Windows NT/2K/XP CreateThread() API? If so, how can I disable this?
> [I.e., I want all my threads to be runnable by any CPU inside the box.]

No CPU affinity is imposed as far as I know; 
Under Linux, this is not possible, at least I've never heard of such a call.


More information about the fpc-pascal mailing list