Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Async Event Threads

Name: Anonymous 2011-11-24 18:53

Is it possible to fork a thread from and asynchronous event loop and have it renable the originating event. Essentially pushing a cpu bound operation into something which has its share of the cpu and passes data back?

Name: Anonymous 2011-11-25 22:20

>>7

some like this could do:



typedef union {
  HaxAniiEvent hax,
  FindAniiEvent find
} Event;

Event event;
while(getNextEvent(&event)) {
  switch(event.type) {
    case HAX_ANII:
      spawn_thread(haxAniiWorkerFunction, event.hax.targetAniiList);
      break;
    case FIND_ANII:
      spawn_thread(anusSearchingFunction, event.find.aniiSearchArea);
      break;
    default:
      assert(0);
  }
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List