threading module oddness

Jason Orendorff jason at jorendorff.com
Fri Dec 21 02:12:35 EST 2001


> >2.  Principle of least surprise.  I think a guy who's done some
> >    thread programming on Linux before, would likely expect Condition
> >    to behave as though it had a pthread cond object inside -- on
> >    Linux anyway.  ("Surely they're not duplicating kernel-level
> >    features in Python...")  I'm no guru, but I'm guessing this
> >    assumption could lead to the occasional subtle bug.
> 
> Possibly.  But any other way of working would likely be detrimental to
> Python's cross-platform capabilities.

Perhaps.  (#2 isn't a very good argument besides.  On Win32 at least,
the APIs provided by the OS can be slow.  They're all kernel calls.
Anything you can get to run mostly in user-space is much faster.)

> Also, it's my experience that 90% of the time that people think they want
> to use any thread synchronization primitives other than RLock() and
> Queue.Queue(), they're wrong.

Hmmm.  You are probably right.

## Jason Orendorff    http://www.jorendorff.com/




More information about the Python-list mailing list