Joe Seigh
7/30/2004 2:30:00 PM
Alexander Terekhov wrote:
>
> Joe Seigh wrote:
> >
> > Nick Maclaren wrote:
> > >
> > > In article <410A44FF.8E914EE7@xemaps.com>,
> > > Joe Seigh <jseigh_01@xemaps.com> writes:
> > > |>
> > > |> POSIX has a Posix Compliance specification that applies separately from
> > > |> the C standard. Among other things, it allows statements to be moved
> > > |> into a locks critical sections, but not out. ...
> > >
> > > Well, you might be right. However, since I am a suspicious person,
> > > and have some reason to believe that you are imagining things, can
> > > you provide a precise reference? Preferably an IEEE publication
> > > number, but anything checkable will do.
> >
> > Well, I don't have a copy of the Posix standard but somebody in c.p.t.
> > can give you the reference. Cross posting to c.p.t.
>
> It (SUS) says "Applications shall ensure that access to any memory
> location by more than one thread of control (threads or processes)
> is restricted such that no thread of control can read or modify a
> memory location while another thread of control may be modifying
> it. Such access is restricted using functions that synchronize
> thread execution and also synchronize memory with respect to other
> threads. The following functions synchronize memory with respect
> to other threads: <snip>. Unless explicitly stated otherwise, if
> one of the above functions returns an error, it is unspecified
> whether the invocation causes memory to be synchronized.
> Applications may allow more than one thread of control to read a
> memory location simultaneously."
>
> That's it. It allows a lot. ;-)
>
> For starters, given that the term "memory location" is defined
> neither by POSIX nor C standard, all threaded POSIX programs
> involve "implementation-specific" behavior that might or might
> not break them.
>
I think we're looking for the stuff that says there is such as
thing as POSIX compliance for C compilers separate from the
C standard.
Also, is there an explicit reference to that moving of statements
into locked critical regions that you bring up every so often?
You made it sound like there was one. There's a big difference
in saying "Posix allows" vs. saying "Posix does not disallow",
especially when the former implies special knowledge about the
lock functions on the part of the compiler.
Joe Seigh