|Question about inter-thread stack references email@example.com (Ivan Godard) (2015-01-15)|
|Re: Question about inter-thread stack references firstname.lastname@example.org (Seima Rao) (2015-01-16)|
|Re: Question about inter-thread stack references email@example.com (Louis Krupp) (2015-01-16)|
|Re: Question about inter-thread stack references firstname.lastname@example.org (glen herrmannsfeldt) (2015-01-17)|
|Re: Question about inter-thread stack references email@example.com (George Neuner) (2015-01-18)|
|Re: Question about inter-thread stack references firstname.lastname@example.org (Stefan Monnier) (2015-01-18)|
|Re: Question about inter-thread stack references email@example.com (Kaz Kylheku) (2015-01-18)|
|[6 later articles]|
|From:||Ivan Godard <firstname.lastname@example.org>|
|Date:||Thu, 15 Jan 2015 23:54:57 -0800|
|Organization:||A noiseless patient Spider|
|Posted-Date:||16 Jan 2015 10:20:12 EST|
If a process has two or more threads running in it, what are the rules
regarding one thread referencing memory in a different thread's stack?
In the usual way that paging hardware works both stacks can be made
visible to both threads, but interstack visibility could also be
prevented (assuming that stacks occupied whole pages). However, if a
stack object can be referenced by a concurrent thread running in another
core then it becomes impossible to optimize and move stack objects into
registers because they might be referenced at any time. Even if the
program were required to declare such data volatile there would still be
I vaguely (so vague that I can't find citations) remember that on some,
possibly legacy, hardware it was physically impossible to do
inter-thread stack accesses; stacks were strictly per-thread and
private. I also vaguely recall that some languages (or thread packages)
banned the practice even if it were physically possible.
Is anyone aware of language/thread package/hardware rules about required
semantics for such usage? Is it explicitly permitted, explicitly banned,
stated to be implementation defined, stated to be undefined, or simply
Thanks for your help.
Return to the
Search the comp.compilers archives again.