[Lazarus] Threads and Libraries (dll and so)

Lukasz Sokol el.es.cr at gmail.com
Fri Feb 7 10:02:27 CET 2014


On 07/02/14 02:57, Hans-Peter Diettrich wrote:
> Mark Morgan Lloyd schrieb:
> 
>> I think that the only thing remotely worth pursuing, bearing in
>> mind the current state of widget sets etc., would be whether an LCL
>> in a dll/so animated by its own thread (which MichaelS has already
>> said was doable) could output to a buffer, which could then be
>> copied in a thread-safe fashion to the main form. I speculate that
>> even if that was doable, getting UI events into the background LCL
>> would be difficult, which in practice would severely curtail the
>> components which could be used.
> 
> That's exactly how it should be done. Threads fill their video
> buffer, then send a message to the GUI thread, to copy the frame into
> the output buffer and request an screen refresh. That's a total of 3
> messages per stream and frame.

I don't know too many details (from just reading LWN...) but it seems 
very similar to the way Wayland is said/described to be working... (At least on Linux)
Everything it handles, is only pixbuffers, clients/applications fill them in. 
Or so I read. YUMV. Not sure about thread awareness/safety though.

But with GTK or QT running on top of it, these libraries become the actual 'buffer fillers'
... and yet we have LCL running on top of that still.

> 
> Eventually the video threads can write directly into the output
> buffer, eliminating one copy action. Then the GUI thread can switch
> between multiple buffers, one to be filled and the other one ready
> for display.
> 
> DoDi

-L.





More information about the Lazarus mailing list