Re: thread static

bill@amber.ssd.hcsc.com (Bill Leonard)
Tue, 15 Aug 1995 19:41:27 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)
[5 later articles]
| List of all articles for this month |
Newsgroups: comp.compilers
From: bill@amber.ssd.hcsc.com (Bill Leonard)
Keywords: parallel
Organization: Harris Computer Systems, Ft. Lauderdale FL
References: 95-08-078
Date: Tue, 15 Aug 1995 19:41:27 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.
>
> Most multi-threaded extensions to 'C' and languages that directly
> support threads (JAVA is the only one I know) concentrate on locking
> resources. This is good. But why not go one step further and allow
> thread specific variables?


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. :-)


Probably the main reason that C hasn't been extended in this way is that
multi-threading is not yet ubiquitous on every system on which C is
supported. The C standard's primary goal is to promote portability;
defining a feature that could not be implemented on many popular computer
platforms would be counter to that goal.


Another reason might the same as the reason why no one produces a 5 pound
chocolate bar -- not enough demand. :-)


--
Bill Leonard
Harris Computer Systems Corporation
2101 W. Cypress Creek Road
Fort Lauderdale, FL 33309
Bill.Leonard@mail.hcsc.com
--


Post a followup to this message

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