Working with Asynchrony Generically: A Tour of C++ Executorsto a compute resource (aka, scheduler) • A unit of lazy async work (aka, sender) • A completion handler (aka, receiver) • A small, initial set of generic async algorithms: • E.g., then, when_all, sync_wait ranges beg asynchronous range adaptors.102 Step 3: Model Ctrl-C as a sender103 struct ctrl_c_handler { struct pending { virtual void complete() = 0; virtual ~pending() {} }; static inline pending->complete(); } return TRUE; } ctrl_c_handler() { BOOL result = ::SetConsoleCtrlHandler(&consoleHandler,TRUE); assert(result); } ~ctrl_c_handler() { BOOL result = ::SetConsoleCtrlHa0 码力 | 121 页 | 7.73 MB | 6 月前3
共 1 条
- 1













