[Lazarus] thread safe

Lukasz Sokol el.es.cr at gmail.com
Thu Jun 30 13:53:39 CEST 2011


On 30/06/2011 11:14, Hans-Peter Diettrich wrote:
> Lukasz Sokol schrieb:
[...]
>> 
>> How is the 'thread safety for classses' different from thread
>> safety for any other code ?
> 
> Thread-safety has many facettes. An item may be safe in one aspect,
> e.g. not using global variables, but unsafe in other aspects.

If it is unsafe in other aspects then it is unsafe, right?
(modulo what you actually need, but AFAIR there is not much too pick&choose from,
because they are related and some of them imply others ?)

> 
> Objects (classes) add further topics to the list of items, that make
> up "thread-safety" in general.

After compilation, it's just code, isn't it? 
Classes may have the 'hidden' variables but they're not 'hidden' to the
OS/CPU ?

> 
> During the various discussions I got the impression, that
> thread-safety only can be a headline or keyword, that leads to a
> detailed description of thread-related properties or behaviour of the
> described item.
> 
AFAIR, code (whatever way you write it) can either BE safe or NOT, no
half measyres here - any one of the 'properties' vel 'aspects' not 
complied with, and you can't name your code thread-safe.

It may be a headline or keyword, but it should list ALL the things one
need to be aware of when writing multi-threaded code?

That's my view.

> DoDi
> 






More information about the Lazarus mailing list