Author: Remi Meier <remi.me...@gmail.com> Branch: c7 Changeset: r636:94b61d8b586a Date: 2014-01-17 23:25 +0100 http://bitbucket.org/pypy/stmgc/changeset/94b61d8b586a/
Log: reducing number of aborts by sleeping diff --git a/c7/core.c b/c7/core.c --- a/c7/core.c +++ b/c7/core.c @@ -376,6 +376,9 @@ uintptr_t lock_idx = (((uintptr_t)obj) >> 4) - READMARKER_START; uint8_t previous; while ((previous = __sync_lock_test_and_set(&write_locks[lock_idx], 1))) { + usleep(1); /* XXXXXX */ + if (!(previous = __sync_lock_test_and_set(&write_locks[lock_idx], 1))) + break; stm_abort_transaction(); /* XXX: only abort if we are younger */ spin_loop(); @@ -897,6 +900,7 @@ _STM_TL2->running_transaction = 0; stm_stop_lock(); + fprintf(stderr, "%c", 'C'+_STM_TL2->thread_num*32); } @@ -975,7 +979,7 @@ assert(_STM_TL1->jmpbufptr != (jmpbufptr_t *)-1); /* for tests only */ _STM_TL2->running_transaction = 0; stm_stop_lock(); - fprintf(stderr, "a"); + fprintf(stderr, "%c", 'A'+_STM_TL2->thread_num*32); /* reset all the modified objects (incl. re-adding GCFLAG_WRITE_BARRIER) */ reset_modified_from_other_threads(); _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit