Question about inter-thread stack references

Ivan Godard <ivan@ootbcomp.com>
Thu, 15 Jan 2015 23:54:57 -0800

          From comp.compilers

Related articles
Question about inter-thread stack references ivan@ootbcomp.com (Ivan Godard) (2015-01-15)
Re: Question about inter-thread stack references seimarao@gmail.com (Seima Rao) (2015-01-16)
Re: Question about inter-thread stack references lkrupp@nospam.pssw.com.invalid (Louis Krupp) (2015-01-16)
Re: Question about inter-thread stack references gah@ugcs.caltech.edu (glen herrmannsfeldt) (2015-01-17)
Re: Question about inter-thread stack references gneuner2@comcast.net (George Neuner) (2015-01-18)
Re: Question about inter-thread stack references monnier@iro.umontreal.ca (Stefan Monnier) (2015-01-18)
Re: Question about inter-thread stack references kaz@kylheku.com (Kaz Kylheku) (2015-01-18)
[6 later articles]
| List of all articles for this month |

From: Ivan Godard <ivan@ootbcomp.com>
Newsgroups: comp.compilers
Date: Thu, 15 Jan 2015 23:54:57 -0800
Organization: A noiseless patient Spider
Keywords: parallel, question
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
locking needed.


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
not mentioned?


Thanks for your help.


Ivan


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.