delphi-blocks / WiRL

WiRL: RESTful Library for Delphi
https://wirl.delphiblocks.dev/
Apache License 2.0
238 stars 84 forks source link

ConfigRegistry is not thread safe #25

Closed bastilw closed 12 months ago

bastilw commented 4 years ago

In Wirl.Core.Application the object FConfigRegistry is not thread safe. It's a simple TObjectList without CriticalSection or anything else. the thread safe equivalent to FConfigRegistry is TWiRLConfigClassRegistry.Instance

lminuti commented 2 years ago

All WiRL registries are not thread safe and I think we doesn't change this behavior in the next releases. Generally the registry are used on the application startup in the mail thread. Using a critical section is not a good idea because you can have many simultaneous threads reading the registries and a critical sections serialize all these threads.

Probably we can use TMultiReadExclusiveWriteSynchronizer but I'm not sure if it is worth the effort.