[Lazarus] Threads

Michael Schnell mschnell at lumino.de
Fri Mar 23 12:02:35 CET 2012


Your concept of threads does not really hold.

Regarding the thread object (TThread descendant) instance itself:

It's creator is called by some thread (usually the project's main 
thread) but of course not by the thread that is going to be created.

Some of it's properties and functions are _supposed_ to be used by the 
thread it owns (e.g. "Terminated")

Some of it's properties and functions are _supposed_ to be used by other 
threads (e.g. "Terminate")

It depends on the user code what self-created additional functions and 
properties are to be used by whom and if they can be considered to be 
thread save.

Same holds for stuff created outside of the thread unit, but supposed to 
be used by the thread ("Execute" procedure).

(There is no simplified concept.)

-Michael




More information about the Lazarus mailing list