https://dalija.prasnikar.info/delphitspatt/
- BrokenMath.dpr
- BrokenMath.dproj
- SafeMath.dpr
- SafeMath.dproj
- Parameters.dpr
- Parameters.dproj
- ParametersMainF.pas
- ParametersMainF.dfm
- Singletons.dpr
- Singletons.dproj
- SingletonsMainF.pas
- SingletonsMainF.dfm
- SingletonClasses.pas
- SingletonLocal.pas
- SingletonClassProp.pas
- SingletonLazy.pas
- CollectionsTest.dpr
- CollectionsTest.dproj
- CollectionsMainF.pas
- CollectionsMainF.dfm
-
13.1 Independent processing of individual collection items
- ParallelCollections.dpr
- ParallelCollections.dproj
- ParallelCollectionsMainF.pas
- ParallelCollectionsMainF.dfm
-
13.2 Dependent processing of individual collection items
- DependentParallelCollections.dpr
- DependentParallelCollections.dproj
- DependentParallelCollectionsMainF.pas
- DependentParallelCollectionsMainF.dfm
- Serialization.dpr
- Serialization.dproj
- SerializationMainF.pas
- SerializationMainF.dfm
- NetClient.dpr
- NetClient.dproj
- NetClientMainF.pas
- NetClientMainF.dfm
- Indy.dpr
- Indy.dproj
- IndyMainF.pas
- IndyMainF.dfm
- RESTDemo.dpr
- RESTDemo.dproj
- RESTMainF.pas
- RESTMainF.dfm
- RegEx.dpr
- Resources.dpr
- Resources.dproj
- ResourcesMainF.pas
- ResourcesMainF.dfm
- Images.dpr
- Images.dproj
- ImagesMainF.pas
- ImagesMainF.dfm
- NX.Log.pas
- Logging.dpr
- Logging.dproj
- NX.Tokens.pas
- Tokens.dpr
- Tokens.dproj
- TokensMainF.pas
- TokensMainF.dfm
- NX.Horizon.pas
- Horizon.dpr
- Horizon.dproj
- HorizonMainF.pas
- HorizonMainF.dfm
- NX.Chronos.pas
- ZeroThread.dpr
- ZeroThread.dproj
Note: Purpose of the presented examples is to either show thread-unsafe code and issues that may arise in such code, or to show general coding patterns for achieving thread-safe code while multiple threads are running. As such many of them don't implement proper cleanup on application shutdown, and if you close the application before started background tasks or threads completed their job, application may crash.
In order to perform clean shutdown, you either need to wait for task or thread completion or use some other mechanism that will prevent accessing GUI or other shared data during application shutdown.
You can find examples on how to shutdown application in https://github.com/dalijap/code-delphi-async Chapter 35.2 Cleanup on GUI destruction