TLF = thread local functions

dennis luehring dl.soluz at gmx.net
Thu Jan 23 22:03:28 PST 2014


Am 23.01.2014 15:44, schrieb Frustrated:
> So, TLS solves the data issue with threading. I just thought,
> with out much thinking, what about having thread local functions?
> Doesn't make sense? Let me explain.
>
> Functions generally are not thread safe because of reentry,
> right? The same data is used by the function for each thread
> calling it and sense threads could effectively call a function
> while the same function is being executed by another thread, the
> data is correct.

no - the parameters and local vars of the function are in the stack of 
the thread - so there is no problem with them, only shared variables can 
have a need to synchronization

your idea tries to solve non existing problems?



More information about the Digitalmars-d-learn mailing list