There is definitely multi-threading involved; If you have 16 threads in your CPU, the compilation of 16 files is kicked off in parallel. So it can be possible that webserver.c
is starting to compile in parallel with other files, but the actual C compilation of the file should only be started after the prebuid action has been run – otherwise the core has a bug. You should clean and repeat compilation a few times to see whether there is some kind of race-condition involved though when multithreading.
Multithreading can be controlled with the -j
option in a pio run
command by the way, for debugging. So -j1
should make is singlethreaded.
>pio run --help
Usage: pio run [OPTIONS]
Options:
-e, --environment TEXT
-t, --target TEXT
--upload-port TEXT
-d, --project-dir PATH
-c, --project-conf FILE
-j, --jobs INTEGER Allow N jobs at once. Default is a number of CPUs
in a system (N=16)
-s, --silent
-v, --verbose
--disable-auto-clean
--list-targets
-h, --help Show this message and exit.