Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Delphi-News aus aller Welt (https://www.delphipraxis.net/58-delphi-news-aus-aller-welt/)
-   -   Overprotecting multithreaded code (https://www.delphipraxis.net/207183-overprotecting-multithreaded-code.html)

DP News-Robot 2. Mär 2021 09:50

Overprotecting multithreaded code
 
Running long tasks in a background thread to keep the UI responsive is one of the main purposes of multithreading. A common code pattern for doing so would look like:

procedure TMainForm.BtnClick(Sender: TObject);
begin
TThread.CreateAnonymousThread(
procedure
begin
DoSomeWork;
end;
end).Start;
end;


However, such code often needs to show the results of that long work to the user. W

Weiterlesen...


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:53 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz