How to use all or a specific number of CPU cores? #66
-
I have read the help output from Is it something I should done from inside my Nelua code (like a pragma?) or is there a flag / command somewhere which I miss? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The Nelua compiler does not use multiple threads to compile at any moment, thus this option does not exist. Writing a multi thread compiler is difficult, time consuming and impose many limitations, moreover the language design decisions like pre processing while compiling does not allow such things happen, because all code must be processed sequentially. The C code is also generated to a single source file for simplicity reasons and other design decisions, thus the C compilation step will also use a single thread because I am not aware of any C compiler that can use multiple threads when compiling a single translation unit. If you are looking for faster compile time in the C compilation step then use a very fast C compiler like TCC with the flag At application execution time, to properly use more cores and threads, you must use a threading library, the nelua-decl project has bindings for three of them |
Beta Was this translation helpful? Give feedback.
The Nelua compiler does not use multiple threads to compile at any moment, thus this option does not exist. Writing a multi thread compiler is difficult, time consuming and impose many limitations, moreover the language design decisions like pre processing while compiling does not allow such things happen, because all code must be processed sequentially. The C code is also generated to a single source file for simplicity reasons and other design decisions, thus the C compilation step will also use a single thread because I am not aware of any C compiler that can use multiple threads when compiling a single translation unit.
If you are looking for faster compile time in the C compilation s…