[Lazarus] Threads and Libraries (dll and so)

Hans-Peter Diettrich DrDiettrich1 at aol.com
Fri Feb 7 04:41:02 CET 2014


Michael Schnell schrieb:
> On 02/06/2014 02:13 PM, Hans-Peter Diettrich wrote:
>> When an application relies on high speed updates, it should serialize 
>> these requests itself, as required, instead of leaving this to the 
>> desktop manager and its arbitrary request scheduling.
> Once again, this is not about serializing "requests" but about allowing 
> as much code as possible to be distributed on multiple CPUs as possible.

The desktop manager does not care about threads, it only manages windows 
as areas on a monitor.

> The "Widget Provider" (including X or whatever) does a fine job 
> serializing the requests to the graphics driver, as you can see when 
> doing the same stuff in multiple applications instead of multiple threads.

Right, but the *timing* of the screen updates is undefined. On Windows a 
screen update (WM_PAINT) is performed at lowest priority, when the 
application (GUI thread) has no other outstanding messages. Then it 
depends on when the application has time to fetch and serve the message. 
This should not be very different in other managers (X11...).

The worst thing an application can do, WRT screen update timing, is 
having the GUI thread busy with other things, like copying large data 
structures (frame bitmaps...).

DoDi





More information about the Lazarus mailing list