[Lazarus] thread safe (was: How to PostMessage to object?)

Hans-Peter Diettrich DrDiettrich1 at aol.com
Fri Jun 10 03:09:07 CEST 2011


Mattias Gaertner schrieb:

> Only if the documentation explicitly says a method is thread safe it is. 
> Maybe this needs to be made more clear. Any ideas, where?

What is "thread safe"?

> There are a few low level functions like FileExistsUTF8 which are thread 
> safe and needs to be documented that they are.

In how far is just FileExistsUTF8 "thread safe"? Even if the file
existed at function return, it can have been killed by somebody else
immediately after, even from outside the application.

Similar situations can exist with every *object*, that can be
manipulated from multiple threads at the same time. In so far I cannot
see how a *function* ever can be documented to be "thread safe" in general.

IMO it would be much more interesting to document, which operations
(functions, objects...) can be used in parallel threads, and how these
can/must be protected for that purpose.


After all: how/where can I find thread-related Lazarus/FPC 
documentation? My wiki search was not really successful :-(

DoDi





More information about the Lazarus mailing list