[Lazarus] Threads in Lazarus code base

Michael Van Canneyt michael at freepascal.org
Wed Sep 15 12:46:10 CEST 2010



On Wed, 15 Sep 2010, Michael Schnell wrote:

> On 09/15/2010 10:48 AM, Michael Van Canneyt wrote:
>> 
>> Threads are a thing of the past as well. I've been programming threads 
>> since years.
>> There is nothing exciting about them, mostly they are a pain.
> OK, but
>
> how do you make a program that is able to non sluggishly communicate with the 
> user while performing decent work (without doing performance-killing polling 
> stuff like "process Messages") ?

What is so performance killing about process messages ?

What do you think the OS does when switching threads ? 
A thread switch is much more expensive than a "process messages".

> how do you make a program doing huge calculations use multiple CPUs which are 
> the contrary of "of the past" ?

I didn't claim to have a better solution. 
I just observed that the very idea of threads is basically flawed.

These are not my words, but the conclusion of scientific research on the subject.

Michael.




More information about the Lazarus mailing list