[pypy-commit] stmgc default: Add a comment about dead threads.

arigo noreply at buildbot.pypy.org
Mon Jun 24 10:43:41 CEST 2013


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r250:83d82fca9ee6
Date: 2013-06-24 10:43 +0200
http://bitbucket.org/pypy/stmgc/changeset/83d82fca9ee6/

Log:	Add a comment about dead threads.

diff --git a/c4/steal.c b/c4/steal.c
--- a/c4/steal.c
+++ b/c4/steal.c
@@ -69,6 +69,15 @@
 void stm_steal_stub(gcptr P)
 {
     struct tx_public_descriptor *foreign_pd = STUB_THREAD(P);
+    /* A note about dead threads: 'foreign_pd' might belong to a thread
+     * that finished and is no longer around.  In this case, note that
+     * this function will not add anything to 'foreign_pd->stolen_objects':
+     * 
+     * 1. the dead thread is not running a transaction, so there are no
+     *    private objects (so no PRIVATE_FROM_PROTECTED)
+     *
+     * 2. the dead thread has no nursery, so all of its objects are old
+     */
 
     spinlock_acquire(foreign_pd->collection_lock, 'S');   /*stealing*/
 


More information about the pypy-commit mailing list