10 Sep
2015
10 Sep
'15
5:57 a.m.
// make a context ready void signal(context* waiter) { if(waiter->preferred_scheduler != this_scheduler) { // cross thread waiter->preferred_scheduler->remote_add(waiter); } else { // no preference or local this->scheduler.next_ready.push_back(waiter); // alternatively push this_context to back of queue and yield to waiter immediately } }
to push a ready fiber to the scheduler from a waitable (mutex, condtion-variable ...) might be a better solution than signaling via an atomic. I'll branch and test your suggestion. thx