[Python-Dev] Making python C-API thread safe (try 2) (original) (raw)
Pat Miller patmiller at llnl.gov
Tue Sep 16 12:24:45 EDT 2003
- Previous message: [Python-Dev] Making python C-API thread safe (try 2)
- Next message: [Python-Dev] Making python C-API thread safe (try 2)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I used to work on the SISAL compiler which was a fine-grained parallel functional language. It reference counted its allocated data.
Updating the reference count is a critical section. We were spending 40% of our time blocked for reference counting on only 4 threads.
We eventually taught the compiler to do reference count optimizations (e.g. put all readers of an object before the writers), but these optimizations are not suitable to the Python interpreter.
With this same reasoning, you can infer why C++ smart pointers are also a bad idea for threaded code.
Pat
-- Patrick Miller | (925) 423-0309 | http://www.llnl.gov/CASC/people/pmiller
All you need in this life is ignorance and confidence, and then success is sure. -- Mark Twain
- Previous message: [Python-Dev] Making python C-API thread safe (try 2)
- Next message: [Python-Dev] Making python C-API thread safe (try 2)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]