Well, if a certain platform relies on an external library, multi-threading could be disabled on that platform through a flag of some kind, at least until something can be programmed for that platform (or more conservatively, only enabled if it's known to work without any hitches). Just an idea. I can't remember off-hand a good enumeration set to include such a flag in though. If multi-threading is not supported, then it can just run single-threaded as it does now.
Gareth aka. Kit On Mon 30/07/18 22:08 , Sven Barth via fpc-devel fpc-devel@lists.freepascal.org sent: Am 30.07.2018 um 19:55 schrieb J. Gareth Moreton: Correct me if I'm mistaken, but I believe one shortcoming with the Free Pascal Compiler, despite its speed, is that it isn't multi-threaded. It can't compile multiple independent units at once, and probably won't be able to for a while due to the use of global variables in the node builder. When it comes to building Lazarus and the compiler, this is gotten around by the Makefiles running several instances of the compiler on different processes, building independent packages that can later be linked. I personally think that if the compiler can be made multi-threaded, then projects like OpenSceneGraph might see a huge improvement in compile times if the compiler is smart enough to identify units that don't depend on each other and compile them in parallel. I'm not sure how cross-compatible it can be made, since different platforms approach multithreading in different ways and I've noticed that the compiler tends to avoid using SysUtils and Classes and the like (so no using TThread for now). TThread is not a necessity. It's functionality and the synchronization primitives are based on what TThreadManager provides. This manager resides in the System unit and is accessible through functions like BeginThread and such. Please note however that this might need an external thread manager on certain platforms (e.g. Unix-like systems) and the idea on those platforms is for the compiler *not* to rely on the C-library. Regards, Sven _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org [1] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel [2]">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel Links: ------ [1] mailto:fpc-devel@lists.freepascal.org [2] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
_______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel