[fpc-devel] Safely shareable objects

Michael Schnell mschnell at lumino.de
Fri Jul 1 14:41:45 CEST 2011


On 07/01/2011 02:47 PM, Hans-Peter Diettrich wrote:
>
> Hmm, when the first reference is stored in a global variable, as was 
> my intention, what happens to the refcount when a method is invoked 
> immediately from that reference?
>
While I do think that a "kind of reference counting" for 
locking/unlocking critical sections in fact is a great idea that 
definitely is worth considering, it might be possible, that the standard 
reference counting done by the compiler is not usable for that and the 
compiler would need to be equipped with a new feature on that behalf.

Thinking about that for just a few minutes I have not been able to come 
up with a definition of where exactly the compiler is supposed to 
increment/decrement the thread-reference-count. Can you ?

-Michael



More information about the fpc-devel mailing list