Re: Inheritable thread locals
Marc Nieper-WiÃkirchen 22 Oct 2022 12:04 UTC
Am Fr., 21. Okt. 2022 um 13:10 Uhr schrieb Shiro Kawai <xxxxxx@gmail.com>:
>
> Ah, Gauche uses its own array of thread local cells so it's possible to copy it when a new thread is created, but if you directly implement each thread local with the underlying system's one, it may not be easy to keep track of them.
>
> I think inheritable thread locals are less used than non-inheritable ones and we can put them off to a later srfi as the demand arises. I wonder if mentioning the possibility of such future enhancement is worth giving hints to the implementers to make design choices.
I agree; we should not block the way to a later addition of
inheritable thread locals. Of course, it may be more manageable if we
can already incorporate them into this SRFI.
The obvious way to implement them would be that there is a global,
weak list of inheritable thread locals. On thread creation, the values
of these thread locals will be copied.
Marc