[Lazarus] Default uses clause in project unit

Mattias Gärtner nc-gaertnma at netcologne.de
Wed Aug 26 17:20:43 CEST 2009


Zitat von Graeme Geldenhuys <graemeg at opensoft.homeip.net>:

> Vincent Snijders wrote:
>>>
>>> If not, then why do we have the extra "IFDEF UseCThreads" define in
>>> the uses clause?
>>>
>>
>> So, it won't be added by default. Don't add it, if you don't need it
>> (or any or you required packages).
>
> But why not add it by default? Windows for example has multi-threading
> support compiled in, even if you use multi-threading or not in your
> application. This applied to Delphi and Kylix as far as I know.

Multithreading means that all strings access need critical sections.
So adding cthreads will deccelerate your application, even if you do  
not start any thread.

See also
http://wiki.lazarus.freepascal.org/Multithreaded_Application_Tutorial#Units_needed_for_a_multi-threaded_application



> Why not do the same for unix-type OSes? I don't understand the reasoning
> to not include it by default. Does it add such a lot to the executable
> file size? Does it add extra dependencies on libraries that might not
> exist in standard installs - though far as I know Posix is available in
> ANY unix-type OS like Linux, *BSD etc...


Mattias






More information about the Lazarus mailing list