Re: thread static

Roger Barnett <Roger@natron.demon.co.uk>
Mon, 21 Aug 1995 22:06:39 GMT

          From comp.compilers

Related articles
thread static chris@tkna.com (1995-08-08)
Re: thread static bill@amber.ssd.hcsc.com (1995-08-15)
Re: thread static mac@yukon.asd.sgi.com (1995-08-18)
Re: thread static stefan.monnier@epfl.ch (Stefan Monnier) (1995-08-21)
Re: thread static pardo@cs.washington.edu (1995-08-21)
Re: thread static Roger@natron.demon.co.uk (Roger Barnett) (1995-08-21)
Re: thread static pardo@cs.washington.edu (1995-08-21)
Re: thread static mfinney@inmind.com (1995-08-22)
Re: thread static erik@kroete2.freinet.de (1995-08-22)
Re: thread static mercier@cinenet.net (1995-08-24)
Re: thread static meissner@cygnus.com (Michael Meissner) (1995-08-24)
Re: thread static stefan.monnier@epfl.ch (Stefan Monnier) (1995-08-28)
[1 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: Roger Barnett <Roger@natron.demon.co.uk>
Keywords: parallel
Organization: Natron Software Maintenance Ltd
References: 95-08-078 95-08-113
Date: Mon, 21 Aug 1995 22:06:39 GMT

chris@tkna.com (Christopher Helck) writes:
> Is there a technical reason why most languages don't support threads? I would
> like to be able to declare in 'C' a variable as "thread static", there would
> be a copy of the variable for each thread. A thread can not modify or read
> another thread's variable.


bill@amber.ssd.hcsc.com (Bill Leonard) writes:
> The POSIX threads standard provides a mechanism for thread-private data,
> but not of course in the form of variable declarations.
>
> Ada does, of course, support multi-threading in the form of tasking, with
> task variables and all the rest. Take a look at the amount of code
> required in an Ada compiler and runtime library and you might get some idea
> of why most languages don't support it. :-)




I'm not sure if this is exactly the same thing, but the RTL/2
language (designed in 1972) includes support for "task private" data
which is declared at the module level as a special case of "global"
data. Most implementations of this either use a dedicated
non-shareable memory area (where supported by an o/s like VMS) or
else reserve space at one end of each task's stack - in the latter
case the "address" of such data items is the offset of the item from
the "start" of the reserved area. As this is often implemented by
simply assigning a dedicated base register, all tasks in a particular
application have to use the same "map" of this private area (i.e.
they all have the same set of private variables). The main uses for
this kind of data tend to be error & exception handling and i/o
management.


--
Roger Barnett
Natron Software Maintenance Ltd, York, England
[ RTL/2 sales & support; reverse engineering; distributed systems ]
--


Post a followup to this message

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