|Question about inter-thread stack references firstname.lastname@example.org (Ivan Godard) (2015-01-15)|
|Re: Question about inter-thread stack references email@example.com (Seima Rao) (2015-01-16)|
|Re: Question about inter-thread stack references firstname.lastname@example.org (Louis Krupp) (2015-01-16)|
|Re: Question about inter-thread stack references email@example.com (glen herrmannsfeldt) (2015-01-17)|
|Re: Question about inter-thread stack references firstname.lastname@example.org (George Neuner) (2015-01-18)|
|Re: Question about inter-thread stack references email@example.com (Stefan Monnier) (2015-01-18)|
|Re: Question about inter-thread stack references firstname.lastname@example.org (Kaz Kylheku) (2015-01-18)|
|Re: Question about inter-thread stack references email@example.com (Ivan Godard) (2015-01-18)|
|[5 later articles]|
|From:||Seima Rao <firstname.lastname@example.org>|
|Date:||Fri, 16 Jan 2015 21:23:14 +0530|
|Keywords:||architecture, parallel, comment|
|Posted-Date:||17 Jan 2015 02:08:58 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?
There are no rules in the hardware. It is possible for a thread to
reference another thread's stack in a flat memory. And then there are
thread implementations which are even loose, they are not strictly OS
recognized thread. These threads all run in application domain.
The simplest solution is to attack the problem at the language level.
At the language level, all your parallelism optimizations are possible
wrt stacks as per C & C++. Once "decided" that the stack is unaliasable across
threads at the language level, the next step would be to
decide about security be it at the language lever, hardware level or
without security, the hw need not care about aliasing as the compiler wont.
With security, all the following layers(there are more layers if one
looks at them)
can cooperate to enforce some discipline:
[Operating system enforced security remains the greatest leveller of them
all but it doesnt belong in this forum. However, if you care , then you
can ship a DLL/Shared Library as one of your layers in security]
[Some hardware has a fully shared address space, some doesn't. The question
is basically what doesn't. I'm fairly sure I've seen something where threads
can't see each other's stacks, but I don't remember what it is. On most
current architectures, it'd require messing with virtual memory tables which
would make switching threads a lot slower, basically the same as process
Return to the
Search the comp.compilers archives again.