[fpc-pascal] Sharing dynamic arrays between threads

Jonas Maebe jonas.maebe at elis.ugent.be
Fri Feb 25 13:36:05 CET 2011


On 25 Feb 2011, at 13:28, Wimpie Nortje wrote:

> Is it safe to create a dynamic array with setlength() in one thread  
> and
> free the array using finalize() in another thread?

Normally, you should not call finalize() on dynamic arrays. When the  
last reference to a dynamic array goes out of scope, it is finalised  
automatically. It is safe when this happens in a different thread than  
the one in which it was created.


Jonas



More information about the fpc-pascal mailing list