Skip to content

Commit

Permalink
added a yield after HG_Progress
Browse files Browse the repository at this point in the history
  • Loading branch information
mdorier committed Jul 31, 2024
1 parent c919055 commit 4a9e8c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/margo-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1930,6 +1930,9 @@ static inline hg_return_t margo_internal_progress(margo_instance_id mid,
monitoring_args.ret = hret;
__MARGO_MONITOR(mid, FN_END, progress, monitoring_args);

/* give a chance to other ULTs to get scheduled */
ABT_thread_yield();

return hret;
}

Expand Down
5 changes: 4 additions & 1 deletion tests/unit-tests/margo-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,10 @@ static MunitResult ref_incr_and_release(const MunitParameter params[], void* dat

static void kill_test(void* args) {
volatile int* x = (int*)args;
sleep(1);
double t = ABT_get_wtime();
while(ABT_get_wtime() - t < 1.0) {
ABT_thread_yield();
}
if(*x == 1) return;
else {
x = NULL;
Expand Down

0 comments on commit 4a9e8c9

Please sign in to comment.