Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #1484

Re: Question about inter-thread stack references

From George Neuner <gneuner2@comcast.net>
Newsgroups comp.compilers
Subject Re: Question about inter-thread stack references
Date 2015-01-18 01:58 -0500
Organization A noiseless patient Spider
Message-ID <15-01-027@comp.compilers> (permalink)
References <15-01-015@comp.compilers>

Show all headers | View raw


Hi Ivan,

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

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

No rules per se, but it isn't even feasible unless the lifetimes of
the references obey strict stack discipline wrt to the lifetime of the
target.  You can find that sort of structure with coroutines and with
map-reduce style parent-child thread relationships - but not in
general.

However, I don't see any compelling reason to permit it.  The stack is
nothing more than a compiler managed mark-release heap: it's only real
benefit to the programmer is no-brainer deallocation.  Anything that
might usefully be done using stack sharing can be done almost as
easily - and much more safely - using an explicit mark-release heap or
stacked heaps (regions, per Tofte and others).

>Ivan
George

Back to comp.compilers | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Question about inter-thread stack references Ivan Godard <ivan@ootbcomp.com> - 2015-01-15 23:54 -0800
  Re: Question about inter-thread stack references Louis Krupp <lkrupp@nospam.pssw.com.invalid> - 2015-01-16 22:28 -0700
    Re: Question about inter-thread stack references glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-01-17 18:46 +0000
  Re: Question about inter-thread stack references George Neuner <gneuner2@comcast.net> - 2015-01-18 01:58 -0500
    Re: Question about inter-thread stack references glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-01-18 21:47 +0000
      Re: Question about inter-thread stack references glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-01-18 23:24 +0000
  Re: Question about inter-thread stack references Stefan Monnier <monnier@iro.umontreal.ca> - 2015-01-18 08:35 -0500
  Re: Question about inter-thread stack references Kaz Kylheku <kaz@kylheku.com> - 2015-01-18 17:12 +0000
  Re: Question about inter-thread stack references Ivan Godard <ivan@ootbcomp.com> - 2015-01-18 12:49 -0800
  Re: Question about inter-thread stack references jgk@panix.com (Joe keane) - 2015-01-25 09:27 +0000
    Re: Question about inter-thread stack references Kaz Kylheku <kaz@kylheku.com> - 2015-01-25 18:46 +0000
      Re: Question about inter-thread stack references jgk@panix.com (Joe keane) - 2015-01-27 02:53 +0000

csiph-web