Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2001-08-06 07:55:39

At 06:07 PM 8/5/2001, John Max Skaller wrote:

>Question: does anyone share stack data between threads?
>Reason for asking:
> 1) Bemans model tries to ban this
> 2) I objected

My original formulation was confusing because it didn't clearly distinguish
between stack data accessed directly by within its thread (not shared) and
stack data access from another thread via pointer or reference (shared).

I've reformulated the description:

Unless otherwise specified, each thread shares all aspects of its execution
environment with other threads in the program. Shared aspects of the
execution environment include, but are not limited to, the following:

· Static storage duration (static, extern) objects [3.7.1].

· Dynamic storage duration (heap) memory [3.7.3]. Thus each memory
allocation will return a unique addresses, regardless of the thread making
the allocation request.

· Automatic storage duration (stack) objects [3.7.2] accessed via pointer
or reference from another thread.

· Resources provided by the operating system. For example, files.

· The program itself. In other words, each thread is executing some
function of the same program, not a totally different program.

Each thread has its own:

· Registers and current execution sequence (program counter) [1.9/5].

· Automatic storage duration (stack) objects [3.7.2].

>but it occurs to me that on a multi-processor, the constraint
>would allow CPU local memory to be used for the stack, which
>could be a significant optimisation.

Since that would disallow inter-thread pointers or references to stack
objects, I don't think it would allow a conforming thread implementation.


Boost list run by bdawes at, gregod at, cpdaniel at, john at