An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151110/e7cedb01/attachment.html>
Mailing lists / lazarus / 2015-11
Event created by program logic rather than user
3 messages · 3 people ·
- EEngelbert Buxbaum 1
- LLukasz Sokol 1
- MMichael Schnell 1
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Engelbert Buxbaum wrote 6 lines
If a long winding calculation runs in a Thread, the complete main thread (including the GUI) is not blocked and the program can do any other stuff (e.g. as a reaction on TTimer events, and also as a reaction on Events this or any other thread fires via TThread.Queue).
Moreover on a multi-CPU system (which is standard nowadays), multiple threads can do long winding calculations at the same time and finish by far faster than a single threaded program.
Even if one did it like that, the original problem remains: who is the sender in the FormPaint call?
As any GUI stuff is only allowed in the main thread it can only be the Main thread (if this is what you are asking)
-Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151110/65c7fa42/attachment.html>
Michael Schnell wrote 11 lines
I'd just add, but,
Moreover on a multi-CPU system (which is standard nowadays), multiple threads can do long winding calculations at the same time and finish by far faster than a single threaded program.
- this, only if the calculation itself is possible to be multithreaded (e.g. formula possible to calculate in chunks/portions/arbitrary bounds etc).
Show quoted text 9 lines
el es
