Commit a280a0c2 authored by Shane Snyder's avatar Shane Snyder

run timer callbacks using margo handler pool

parent c5628a48
...@@ -100,10 +100,9 @@ int main(int argc, char **argv) ...@@ -100,10 +100,9 @@ int main(int argc, char **argv)
} }
/* actually start margo */ /* actually start margo */
/* use a single pool for progress and sleeper threads */ /* use a single pool for progress, sleeper, and handler threads */
/* NOTE: no rpc handler threads are needed */
/***************************************/ /***************************************/
mid = margo_init(pool, ABT_POOL_NULL, hg_context, hg_class); mid = margo_init(pool, pool, hg_context, hg_class);
for(i=0; i<4; i++) for(i=0; i<4; i++)
{ {
t_ids[i] = i; t_ids[i] = i;
......
...@@ -139,8 +139,10 @@ void margo_timer_destroy( ...@@ -139,8 +139,10 @@ void margo_timer_destroy(
void margo_check_timers( void margo_check_timers(
margo_instance_id mid) margo_instance_id mid)
{ {
int ret;
margo_timer_t *cur; margo_timer_t *cur;
struct margo_timer_instance *timer_inst; struct margo_timer_instance *timer_inst;
ABT_pool *handler_pool;
double now = ABT_get_wtime(); double now = ABT_get_wtime();
timer_inst = margo_get_timer_instance(mid); timer_inst = margo_get_timer_instance(mid);
...@@ -157,8 +159,11 @@ void margo_check_timers( ...@@ -157,8 +159,11 @@ void margo_check_timers(
DL_DELETE(timer_inst->queue_head, cur); DL_DELETE(timer_inst->queue_head, cur);
cur->prev = cur->next = NULL; cur->prev = cur->next = NULL;
/* execute callback */ /* schedule callback on the handler pool */
cur->cb_fn(cur->cb_dat); handler_pool = margo_get_handler_pool(mid);
ret = ABT_thread_create(*handler_pool, cur->cb_fn, cur->cb_dat,
ABT_THREAD_ATTR_NULL, NULL);
assert(ret == ABT_SUCCESS);
} }
ABT_mutex_unlock(timer_inst->mutex); ABT_mutex_unlock(timer_inst->mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment