[Python-Dev] Should Python #define _POSIX_THREADS?

Thomas Wouters thomas@xs4all.net
Thu, 5 Apr 2001 23:27:12 +0200


On Thu, Apr 05, 2001 at 02:40:59PM -0400, Jason Tishler wrote:

> > We could define _POSIX_THREADS only if it isn't already defined. Or better
> > yet, defined PY_POSIX_THREADS, have the Python source itself just trigger
> > off of that, and #define _POSIX_THREADS somewhere in pyport.h,
> > PY_POSIX_THREADS is defined and _POSIX_THREADS is not.

> I was thinking of something like the above, but not with as much
> understanding as you already have.  Would you be willing to submit such
> a patch for consideration *after* 2.1 final?

Actually, I think the above should go in *before* 2.1 final. It won't break
anything new, and it fixes some warnings and possible some problems.
Because:

- if _POSIX_THREADS is not already defined, nothing changes
- if _POSIX_THREADS is already defined, to the same value as we are defining
  it to, nothing changes
- if _POSIX_THREADS is already defined, but to a different value than Python
  wants to define it to, it used to break and starts working now. There is
  nothing that depends on the actual value of _POSIX_THREADS in Python right
  now (because it doesn't *have* a value.)

Unfortunately, I lack the time to write the patch and test it. I'm busy
moving, redecorating the house I'm half moved into, lack any kind of
connectivity at home (*@#$&*! cable and DSL companies), and have several
projects at work that *need* my 80h/week attention (each one) the next few
of months at least. Python (and Mailman, btw, Barry) are *slightly* on the
back burner right now.

But if someone does write a patch, I can make the time to test it on the
BSDI and FreeBSD machines I have (asside from the Linux machines everyone
and their dog has, nowadays :)

Jetlagged-at-Apachecon-ly y'rs,
-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!