Changeset: 7f815be9d9bd for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7f815be9d9bd Modified Files: gdk/gdk_aggr.c Branch: qcancel Log Message:
timeout averages diffs (35 lines): diff --git a/gdk/gdk_aggr.c b/gdk/gdk_aggr.c --- a/gdk/gdk_aggr.c +++ b/gdk/gdk_aggr.c @@ -1731,6 +1731,8 @@ BATprod(void *res, int tp, BAT *b, BAT * if (avgs == NULL) \ goto alloc_fail; \ while (ncand > 0) { \ + GDK_CHECK_TIMEOUT(timeoffset, counter,\ + GOTO_LABEL_TIMEOUT_HANDLER(alloc_fail));\ ncand--; \ i = canditer_next(&ci) - b->hseqbase; \ if (gids == NULL || \ @@ -1768,6 +1770,8 @@ BATprod(void *res, int tp, BAT *b, BAT * for (i = 0; i < ngrp; i++) \ dbls[i] = 0; \ while (ncand > 0) { \ + GDK_CHECK_TIMEOUT(timeoffset, counter,\ + GOTO_LABEL_TIMEOUT_HANDLER(alloc_fail));\ ncand--; \ i = canditer_next(&ci) - b->hseqbase; \ if (gids == NULL || \ @@ -1813,6 +1817,13 @@ BATgroupavg(BAT **bnp, BAT **cntsp, BAT const char *err; lng t0 = 0; + size_t counter = 0; + lng timeoffset = 0; + QryCtx *qry_ctx = MT_thread_get_qry_ctx(); + if (qry_ctx != NULL) { + timeoffset = (qry_ctx->starttime && qry_ctx->querytimeout) ? (qry_ctx->starttime + qry_ctx->querytimeout) : 0; + } + TRC_DEBUG_IF(ALGO) t0 = GDKusec(); assert(tp == TYPE_dbl); _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list