Changeset: 0cf1e14b0302 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/0cf1e14b0302
Modified Files:
        gdk/gdk_bbp.c
Branch: multi-cachelock
Log Message:

lists are now per thread, ie no other thread can allready alloc

use ATOMIC_ADD instead of ATOMIC_SET


diffs (25 lines):

diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -2470,12 +2470,6 @@ maybeextend(Thread t) {
 
        MT_lock_set(&BBPnameLock);
 
-       /* thread list was already extended by another concurrent transaction */
-       if (t->free > 0) {
-               MT_lock_unset(&BBPnameLock);
-               return GDK_SUCCEED;
-       }
-
        bat size = (bat) ATOMIC_GET(&BBPsize);
        /* if the common pool has no more space, extend it */
        if (size + FREE_LIST_CHUNK_SIZE > BBPlimit) {
@@ -2495,7 +2489,7 @@ maybeextend(Thread t) {
        assert(t->stat_free_count == 0);
        t->stat_free_count += FREE_LIST_CHUNK_SIZE;
 
-       ATOMIC_SET(&BBPsize, size + FREE_LIST_CHUNK_SIZE);
+       ATOMIC_ADD(&BBPsize, FREE_LIST_CHUNK_SIZE);
 
        MT_lock_unset(&BBPnameLock);
        return GDK_SUCCEED;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to