gabr42
The second edition of my book Delphi High Performance is now released! Get all 452 pages of Delphi goodness with two new chapters and all the updated and improved content at Amazon or at Packt Publishing!— Published… … Read more
1 year ago in Books, Delphi, high performance, multithreading, programming0
Dalija Prasnikar
One of the more common problems that comes up in multi-threading, especially when refactoring existing code, is assigning a result obtained from asynchronous code. In other words, how do you write a function that will… … Read more
2 years ago in Asynchronous programming, Delphi, multithreading0
Dalija Prasnikar
Here you can find slides from my CodeRage 2022 presentation about Challenges of Multi-threaded Programming, as well as additional links to code examples related to the presentation. Slides: https://dalija.prasnikar.info/dl/DP_CodeRage2022.pdf Additiona… … Read more
2 years ago in CodeRage2022, eventbus, multithreading, Webinar0
Dalija Prasnikar
Delphi Thread Safety Patterns book is now available as paperback on Amazon, too. https://dalija.prasnikar.info/delphitspatt/While the thread safety of a particular piece of code depends on the surrounding context and how it is used, some data types… … Read more
2 years ago in book, Delphi, multithreading0
Dalija Prasnikar
One of the topics raised in yesterday’s FreeAndNil debate was using FreeAndNil in multi-threaded code for avoiding access to a dangling reference when multiple threads are accessing and using the same object instance. Problem is… … Read more
2 years ago in Delphi, FreeAndNil, multithreading0
Dalija Prasnikar
Anonymous threads are simple to use and are highly appealing when you need to quickly put and execute some small piece of code in a background thread. They work great when they run and complete,… … Read more
2 years ago in Delphi, multithreading0
Dalija Prasnikar
Delphi Thread Safety Patterns Bookhttps://dalija.prasnikar.info/delphitspatt/While the thread safety of a particular piece of code depends on the surrounding context and how it is used, some data types are inherently unsafe, and for some of them,… … Read more
2 years ago in book, Delphi, multithreading0
Dalija Prasnikar
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( … … Read more
4 years ago in Delphi, multithreading, synchronize0
gabr42
While the TLightweightMREW is quite handy, it is not perfect. There’s a weird assymmetry in it. On all operating systems that Delphi can compile for, read locks are reentrant (recursive) while write locks are not. In other words,… … Read more
4 years ago in Delphi, multithreading, programming, synchronization0
gabr42
In order to convince you that a readers-writer lock is not a stupid idea, I should finally show some numbers. In this article I’ll present a minimalistic (but still real-life) example which allows us to… … Read more
4 years ago in Delphi, multithreading, programming, synchronization0