[Lazarus] Threads in Lazarus code base
mschnell at lumino.de
Wed Sep 15 12:46:07 CEST 2010
On 09/15/2010 12:38 PM, Juha Manninen (gmail) wrote:
> On Wednesday 15 September 2010 13:32:20 Michael Schnell wrote:
>> Maybe you could start an external process for this ....
> ... and pass the data with temporary text files?
> Why would I do that? A thread is lighter, it can see the variables I already
> defined, it is easier to synchronize (WaitFor in this case)...
Linux is very good with passing data via pipes. stdout is always present
and can be captured by the parent process. This in fact is the "Unix
way" to do those things (rather than using Threads). But I am sure it
can be done with windows and Mac, too.
> What is wrong with threads?
Nothing. It's just error-prone. Enabling CThreads slightly reduces the
overall performance, but I don't think it's relevant.
More information about the Lazarus