Re: Per-thread working directory and umask proposal
Marc Nieper-Wißkirchen 23 Apr 2020 16:13 UTC
Am Do., 23. Apr. 2020 um 18:07 Uhr schrieb John Cowan <xxxxxx@ccil.org>:
[...]
> 2) When thread foo spawns thread bar, does bar:
>
> a) get a per-thread CWD that is a copy of the per-process CWD, or
>
> b) get a per-thread CWD that is a copy of foo's per-thread CWD, or
>
> c) get a per-thread CWD that *is* foo's per-thread CWD, such that mutations done in foo are visible in bar and vice versa?
>
> These are the three implementations documented for SRFI 39 parameters. In R7RS-small, parameter mutations are not standardized (though not disallowed either), so the difference between (b) and (c) is not visible.
When we discuss threads for R7RS-large, we should revisit mutation of
SRFI 39 parameters. While R7RS-small is silent on the issue, I would
like to have some standardization for R7RS-large. A threading facility
should provide thread-local variables and SRFI 39 parameters sound
like the best fit. Mutating a thread-local variable shouldn't change
its value in another thread. Thus, I would strongly favor what you
have labeled b).
Maybe Marc as an expert and the author of SRFI 18 and SRFI 39 can
comment on this.