Changeset: b74244ccf9ff for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/b74244ccf9ff Branch: groupjoin Log Message:
merged with default diffs (144 lines): diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -7,3 +7,9 @@ During the upgrade function definitions will fallback to the normal PYTHON language option. +* Mon Jul 17 2023 Panagiotis Koutsourakis <kutsu...@monetdbsolutions.com> +- Implemented direct masking for strimp construction. The strimps + datastructure now keeps an array of 65K 64-bit integers that is zero + everywhere except at the indexes that correspond to header pairs. The + entry for the nth pair in order has the nth bit of the bitstring + on. These can be used to quickly construct bitstrings. diff --git a/ChangeLog.strimps-updates b/ChangeLog.strimps-updates deleted file mode 100644 --- a/ChangeLog.strimps-updates +++ /dev/null @@ -1,10 +0,0 @@ -# ChangeLog file for strimpsv2 -# This file is updated with Maddlog - -* Mon Jul 17 2023 Panagiotis Koutsourakis <kutsu...@monetdbsolutions.com> -- Implemented direct masking for strimp construction. The strimps - datastructure now keeps an array of 65K 64-bit integers that is zero - everywhere except at the indexes that correspond to header pairs. The - entry for the nth pair in order has the nth bit of the bitstring - on. These can be used to quickly construct bitstrings. - diff --git a/monetdb5/mal/mal_dataflow.c b/monetdb5/mal/mal_dataflow.c --- a/monetdb5/mal/mal_dataflow.c +++ b/monetdb5/mal/mal_dataflow.c @@ -82,7 +82,7 @@ typedef struct DATAFLOW { struct worker { MT_Id id; - enum { WAITING, RUNNING, FREE, EXITED } flag; + enum { WAITING, RUNNING, FREE, EXITED, FINISHING } flag; ATOMIC_PTR_TYPE cntxt; /* client we do work for (NULL -> any) */ MT_Sema s; struct worker *next; @@ -245,6 +245,7 @@ static void DFLOWworker(void *T) { struct worker *t = (struct worker *) T; + bool locked = false; #ifdef _MSC_VER srand((unsigned int) GDKusec()); #endif @@ -411,20 +412,8 @@ DFLOWworker(void *T) } } MT_lock_set(&dataflowLock); - if (GDKexiting() || ATOMIC_GET(&exiting)) { - MT_lock_unset(&dataflowLock); - break; - } - if (free_count >= free_max) { - struct worker **tp = &workers; - while (*tp && *tp != t) - tp = &(*tp)->next; - assert(*tp && *tp == t); - *tp = t->next; - t->flag = EXITED; - t->next = exited_workers; - exited_workers = t; - MT_lock_unset(&dataflowLock); + if (GDKexiting() || ATOMIC_GET(&exiting) || free_count >= free_max) { + locked = true; break; } free_count++; @@ -442,6 +431,19 @@ DFLOWworker(void *T) break; assert(t->flag == WAITING); } + if (!locked) + MT_lock_set(&dataflowLock); + if (t->flag != FINISHING) { + struct worker **tp = t->flag == FREE ? &free_workers : &workers; + while (*tp && *tp != t) + tp = &(*tp)->next; + assert(*tp && *tp == t); + *tp = t->next; + t->flag = EXITED; + t->next = exited_workers; + exited_workers = t; + } + MT_lock_unset(&dataflowLock); GDKsetbuf(NULL); } @@ -747,6 +749,7 @@ DFLOWscheduler(DataFlow flow, struct wor static inline void finish_worker(struct worker *t) { + t->flag = FINISHING; MT_lock_unset(&dataflowLock); MT_join_thread(t->id); MT_sema_destroy(&t->s); @@ -944,6 +947,8 @@ stopMALdataflow(void) } while (free_workers) { struct worker *t = free_workers; + assert(free_count > 0); + free_count--; free_workers = free_workers->next; MT_sema_up(&t->s); finish_worker(t); @@ -953,6 +958,11 @@ stopMALdataflow(void) workers = workers->next; finish_worker(t); } + while (exited_workers) { + struct worker *t = exited_workers; + exited_workers = exited_workers->next; + finish_worker(t); + } MT_lock_unset(&dataflowLock); } } diff --git a/sql/test/BugTracker-2020/Tests/All b/sql/test/BugTracker-2020/Tests/All --- a/sql/test/BugTracker-2020/Tests/All +++ b/sql/test/BugTracker-2020/Tests/All @@ -26,7 +26,7 @@ table-udf-column-descriptor.Bug-6964 table-udf-distinct.Bug-6965 table-udf-on-remote.Bug-6971 integers-intervals.Bug-6979 -KNOWNFAIL?wrong-key-error.Bug-6982 +wrong-key-error.Bug-6982 window-function-order.Bug-6997 semijoin.Bug-7001 decimal-multiplication.Bug-7003 diff --git a/sql/test/BugTracker-2021/Tests/All b/sql/test/BugTracker-2021/Tests/All --- a/sql/test/BugTracker-2021/Tests/All +++ b/sql/test/BugTracker-2021/Tests/All @@ -1,7 +1,7 @@ update-from-count.Bug-7079 remote-table-ranges.Bug-7089 #KNOWNFAIL?query-too-complex.Bug-7092 # this is a feature request rather than a bug -KNOWNFAIL?remote-table-rollback.Bug-7094 +remote-table-rollback.Bug-7094 ntile-wrong-result.Bug-7104 union-groupby.Bug-7108 merge-stmt.wrong-error.Bug-7109 _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org