<p>Am 22.09.2014 17:33 schrieb "Peter Popov" <<a href="mailto:ppopov@hotmail.com">ppopov@hotmail.com</a>>:<br>
> I will add another comment to the race condition issues: they are easily avoided by a single line assembly atomic inc/dec. It however will not resolve performance issues where a certain function assigns classes references left and right and there are multiple threads. The fact that you can easily protect it does not mean that you will retain parallel efficiency. Thread-syncing should be left to the programmer to optimize.</p>
<p>Of course the reference count changing would use atomic operations (in Pascal implemented by the Interlocked* group of functions) just as it is done for strings, arrays and interfaces. Thuse there would be no need to worry about race conditions regarding the reference counting, only for the class logic itself which is the developer's job anyway.</p>
<p>Regards,<br>
Sven</p>