[Python-Dev] pthreads question: typedef ??? pthread_t and hacky return statements

Mark Favas m.favas@per.dem.csiro.au
Sat, 19 Aug 2000 04:33:21 +0800


Tim Peters wrote:
> 
> [Mark Favas]
> > return (long) threadid;
> >
> > compiles without warnings, and all tests pass on OSF/1 (aka Tru64 Unix).
> > Removing the "volatile" is also fine for me, but may affect Vladimir.
> > I'm still a bit (ha!) confused by Tim's comments that the function is
> > bogus for OSF/1 because it throws away half the bits, and will therefore
> > result in id collisions - this will only happen on platforms where
> > sizeof(long) is less than sizeof(pointer), which is not OSF/1
> 
> Pure guess on my part -- couldn't imagine why a compiler would warn *unless*
> bits were being lost.  Are you running this on an Alpha?  The comment in the
> code specifically names "Alpha OSF/1" as the culprit.  I don't know anything
> about OSF/1; perhaps "Alpha" is implied.

Yep - I'm running on an Alpha. The name of the OS has undergone a couple
of, um, appellation transmogrifications since the first Alpha was
produced by DEC: OSF/1 -> Digital Unix -> Tru64 Unix, although uname has
always reported "OSF1". (I don't think that there's any other
implementation of OSF/1 left these days... not that uses the name,
anyway.)

> 
> > ...
> > In summary, whatever issue there was for OSF/1 six (or so) years ago
> > appears to be no longer relevant - but there will be the truncation
> > issue for Win64-like platforms.
> 
> And there's Vladimir's "volatile" hack.

Wonder if that also is still relevant (was it required because of the
long * long * cast?)...

-- 
Email  - m.favas@per.dem.csiro.au        Mark C Favas
Phone  - +61 8 9333 6268, 0418 926 074   CSIRO Exploration & Mining
Fax    - +61 8 9383 9891                 Private Bag No 5, Wembley
WGS84  - 31.95 S, 115.80 E               Western Australia 6913