Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion thread safety
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
James Kuyper  
View profile  
 More options Jun 14 2003, 4:53 pm
Newsgroups: comp.lang.fortran, comp.std.c
From: kuy...@wizard.net (James Kuyper)
Date: 14 Jun 2003 13:53:31 -0700
Local: Sat, Jun 14 2003 4:53 pm
Subject: Re: thread safety

Dan Nagle <dna...@erols.com> wrote in message <news:74ijevo11fao36lises4ff6e5aj2tnbu14@4ax.com>...
> Hello,

> On Thu, 12 Jun 2003 12:17:51 -0700, "E. Robert Tisdale"
> <E.Robert.Tisd...@jpl.nasa.gov> wrote:
...
> >Fortran proponents argue that, since the ANSI/ISO C standards
> >do *not* explicitly specify thread safety, there is no guarantee that
> >it is possible to write portable thread safe [sub]programs in C either.

> The second paragraph of C99 5.1.2.3 is becoming notorious.  :-)
> It is taken as implying that C99 defines single threaded execution.
> The conclusion is drawn that multithreaded execution is beyond C99.
> Which leads us right back to the "thread safe means more than
> storage class" perspective.

It describes an execution environment in which the possibility of
multiple threads has not even been considered, which means that in
some ways it implicitly assumes single-threaded behavior. Therefore, a
conforming implementation of C on a platform which supports multiple
threads, can compile a strictly conforming program to make use of
multiple threads, only by invoking the "as-if" rule. That means,
basically, that the observable results of the multi-threaded behavior
must be essentially the same as if 5.1.2.3 had been followed literally
for some permitted order of evaluation of the statements and
expressions that make up the program.  This provides only a very
limited amount of freedom for multi-threaded implementation of the
program. It's not enough to be really useful, in itself.

However, any program that makes real use of threads will have behavior
that is undefined behavior under the C standard. That's because the
thread primitives are necessarily written in non-strictly conforming
C, because strictly-conforming C doesn't have the features neede to
implement those primitives. Therefore, any program that uses them has
behavior that is at best, implementation-defined, as far as the C
standard is concerned. In most cases, it has undefined behavior. That
gives the implementation all the freedom it needs to make those
threading primitives do whatever it needs them to do. If they conform
to some other standard, such as POSIX, then the behavior becomes
defined; but not by the C standard.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.