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

Tim Peters tim_one@email.msn.com
Fri, 18 Aug 2000 04:10:01 -0400


-0 on autoconf for this.

I doubt that Trent ever needs to know more than in this one place the
relative sizes of threadid and a long, and this entire function is braindead
(hence will be gutted someday) anyway.  Using the explicit test makes it
obvious to everyone; winding back thru layers of autoconf crust makes it A
Project and yet another goofy preprocessor symbol cluttering the code.

> -----Original Message-----
> From: Thomas Wouters [mailto:thomas@xs4all.net]
> Sent: Friday, August 18, 2000 3:17 AM
> To: Tim Peters
> Cc: Trent Mick; python-dev@python.org
> Subject: Re: [Python-Dev] pthreads question: typedef ??? pthread_t and
> hacky return statements
>
>
> On Thu, Aug 17, 2000 at 11:39:29PM -0400, Tim Peters wrote:
>
> > So how about a runtime test for what's actually important (and it's not
> > Monterey!)?
> >
> > 	if (sizeof(threadid) <= sizeof(long))
> > 		return (long)threadid;
> >
> > End of problem, right?  It's a cheap runtime test in a function
> > whose speed isn't critical anyway.
>
> Note that this is what autoconf is for. It also helps to group all that
> behaviour-testing code together, in one big lump noone pretends to
> understand ;)
>
> --
> Thomas Wouters <thomas@xs4all.net>
>
> Hi! I'm a .signature virus! copy me into your .signature file to
> help me spread!