Corrections:

Now, every thread keeps one n queue of objects to incref and second 
queue to decref.
Both can be implemented as array, cause they will be freed at once.

Initially, every thread acquires GIL for "read".
Py_INCREF places a ref into a incref queue of a thread,
Py_DECREF places a ref into a decref queue of a thread.
When queue has became full or "100" instruction left ( :-) , it usefull),
thread releases GIL for "read" and acquires for "write",
when first process acquire it he:
      walk throw all incref queues in all threads, incref all thouse 
refs, and clear queues.
      then walk throw all decref queues in all threads, decref all 
thouse refs, and clear queues
After all he acquires GIL for "read". Other processes could stupidly 
repeat it founding clear queues.
Since there only one thread works as a "garbage collector", we will not 
loose any incref and decref.

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to