Threads and Static Data
Craig Black
cblack at ara.com
Wed Dec 12 12:31:24 PST 2007
> - My second point was that a specific thread-local storage
> mechanism isn't really needed if the libraries are properly
> designed. Properly designed libraries should have an "Init" or
> "Open" function that returns a handle, then all other functions
> should take that handle as a parameter(*). For such libraries, local
> variables are enough and a mechanism such as described in the
> Wikipedia page is overkill. Therefore, I don't think it's really
> necessary to add it to the core language: having it implemented in a
> library is enough for the rare cases where it's impossible to do
> without.
Ok, you are saying it's not necessary to make it part of the language. You
are right, this can be done pretty well without language support. It just
requires a little more thought. This solution is still called thread-local
storage I think even if it's not a language feature.
More information about the Digitalmars-d
mailing list