Changeset: 5a59e9a76af0 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5a59e9a76af0 Modified Files: gdk/gdk_mosaic.c Branch: mosaic Log Message:
Avoid msync thread avalanche The optimizer can trigger a large number of msyncs, which may lead to concurrency issues accessing the underlying BAT descriptor. diffs (24 lines): diff --git a/gdk/gdk_mosaic.c b/gdk/gdk_mosaic.c --- a/gdk/gdk_mosaic.c +++ b/gdk/gdk_mosaic.c @@ -84,16 +84,15 @@ BATmosaic(BAT *bn, BUN cap) m->parentid = bn->batCacheid; #ifdef PERSISTENTMOSAIC - if ((BBP_status(bn->batCacheid) & BBPEXISTING) && - bn->batInserted == bn->batCount) { - MT_Id tid; - struct mosaicsync *hs = GDKmalloc(sizeof(*hs)); + if ((BBP_status(bn->batCacheid) & BBPEXISTING) && bn->batInserted == bn->batCount) { + struct mosaicsync *hs = GDKzalloc(sizeof(*hs)); if (hs != NULL) { BBPfix(bn->batCacheid); hs->id = bn->batCacheid; hs->hp = m; hs->func = "BATmosaic"; - MT_create_thread(&tid, BATmosaicsync, hs, MT_THR_DETACHED); + //only for large ones and when there is no concurrency: MT_create_thread(&tid, BATmosaicsync, hs, MT_THR_DETACHED); + BATmosaicsync(hs); } } else ALGODEBUG fprintf(stderr, "#BATmosaic: NOT persisting index %d\n", bn->batCacheid); _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list