1al_get_cpu_count(3) al_get_cpu_count(3)
2
3
4
6 al_get_cpu_count - Allegro 5 API
7
9 #include <allegro5/allegro.h>
10
11 int al_get_cpu_count(void)
12
14 Returns the number of CPU cores that the system Allegro is running on
15 has and which could be detected, or a negative number if detection
16 failed. Even if a positive number is returned, it might be that it is
17 not correct. For example, Allegro running on a virtual machine will
18 return the amount of CPU's of the VM, and not that of the underlying
19 system.
20
21 Furthermore even if the number is correct, this only gives you informa‐
22 tion about the total CPU cores of the system Allegro runs on. The
23 amount of cores available to your program may be less due to circum‐
24 stances such as programs that are currently running.
25
26 Therefore, it's best to use this for advisory purposes only. It is
27 certainly a bad idea to make your program exclusive to systems for
28 which this function returns a certain "desirable" number.
29
30 This function may be called prior to al_install_system(3) or
31 al_init(3).
32
34 5.1.12
35
36
37
38Allegro reference manual al_get_cpu_count(3)