From Eager Futures/Promises to Lazy Continuations: Evolving an Actor Library Based on Lessons LearnedFrom Eager Futures/Promises to Lazy Continuations Evolving an Actor Library Based on Lessons Learned from Large-Scale Deployments Benjamin Hindman @benh CppCon 2021prologue ● past life at UC motivating futures/promises + actors (2) libprocess (3) revisiting the problem (4) evolution of libprocess (5) eventuals (6) scheduling (7) streams (8) type erasurechapters (1) motivating futures/promises different language (e.g., Erlang) … or bring Erlang to C++! use callbacks … more on this later use futures/promises …possible solutions just wait … use threads … too expensive, not conducive to correctness0 码力 | 264 页 | 588.96 KB | 6 月前3
Tornado 6.5 Documentationin Tornado generally return placeholder objects (Futures), with the exception of some low-level components like the IOLoop that use callbacks. Futures are usually transformed into their result with the coroutines: have additional integration with the concurrent.futures [https://docs.python.org/3/library/concurrent.futures.html#module-concurrent.futures] package, allowing the result of executor.submit to be way to call a blocking function from a coroutine is to use IOLoop.run_in_executor, which returns Futures that are compatible with coroutines: async def call_blocking(): await IOLoop.current().run_in_executor(None0 码力 | 437 页 | 405.14 KB | 3 月前3
Tornado 6.5 Documentationin Tornado generally return placeholder objects (Futures), with the exception of some low- level components like the IOLoop that use callbacks. Futures are usually transformed into their result with the have somewhere to go. • Decorated coroutines: – have additional integration with the concurrent.futures package, allowing the result of executor. submit to be yielded directly. For native coroutines, use way to call a blocking function from a coroutine is to use IOLoop.run_in_executor, which returns Futures that are compatible with coroutines: async def call_blocking(): await IOLoop.current().run_in_executor(None0 码力 | 272 页 | 1.12 MB | 3 月前3
Spanny 2: Rise of std::mdspantype*/> futures; for (auto i = 0u; i != bins.extent(0); ++i) { for (auto j = 0u; j != bins.extent(1); ++j) { futures.push_back(bins(i, j)); while (!futures.empty()) std::erase_if(futures, [](auto& type*/> futures; for (auto i = 0u; i != bins.extent(0); ++i) { for (auto j = 0u; j != bins.extent(1); ++j) { futures.push_back(bins(i, j)); while (!futures.empty()) std::erase_if(futures, [](auto& type*/> futures; for (auto i = 0u; i != bins.extent(0); ++i) { for (auto j = 0u; j != bins.extent(1); ++j) { futures.push_back(bins(i, j)); while (!futures.empty()) std::erase_if(futures, [](auto&0 码力 | 117 页 | 2.02 MB | 6 月前3
Distributed Ranges: A Model for Building Distributed Data Structures, Algorithms, and ViewstemplateT reduce(R&& r, T init) { std::vector* future type */> futures; for (auto&& segment : segments(r)) { if (size(segment) > 0) { auto rank = rank(segment); get_device_policy(rank); auto f = dpl::reduce_async(policy, segment); futures.push_back(f); } } for (auto&& f : futures) { init += f.get(); } return init; }Distributed Algorithms - template T reduce(R&& r, T init) { std::vector* future type */> futures; for (auto&& segment : segments(r)) { if (size(segment) > 0) { auto rank = rank(segment); 0 码力 | 127 页 | 2.06 MB | 6 月前3
Comprehensive Rust(English) 20241263.1 async/await . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351 63.2 Futures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352 63.3 Runtimes . scheduling using threads and mutexes) and async/await con- currency (cooperative multitasking using futures). 11 Non-Goals Rust is a large language and we won't be able to cover all of it in a few days asynchronous operation is based on ”futures”, which represent work that may be completed in the future. Futures are ”polled” until they signal that they are complete. Futures are polled by an async runtime0 码力 | 382 页 | 1.00 MB | 10 月前3
DEDUCING this PATTERNSMid 2013: I start playing with monadic futures. I run into a problem.FIRST, AN ORIGIN STORY (and timeline of sorts) Mid 2013: I start playing with monadic futures. I run into a problem. May 2014: I go first time.FIRST, AN ORIGIN STORY (and timeline of sorts) Mid 2013: I start playing with monadic futures. I run into a problem. May 2014: I go to C++Now for the first time. May 2015: I go back to C++Now problem.FIRST, AN ORIGIN STORY (and timeline of sorts) Mid 2013: I start playing with monadic futures. I run into a problem. May 2014: I go to C++Now for the first time. May 2015: I go back to C++Now0 码力 | 126 页 | 5.15 MB | 6 月前3
Comprehensive Rust(Português do Brasil) 20241264.1 async/await . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356 64.2 Futures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357 64.3 Tempos de Execução utilizando threads e mutexes) quanto concorrência async/await (multitarefa cooperativa utilizando futures). 11 Fora do escopo Rust é uma linguagem extensa e não conseguiremos cobrir tudo em poucos dias assíncrona do Rust é baseada em ”futures”, que representam trabalho que pode ser concluído no futuro. As futures são ”polled” até que elas sinalizem que estão completas. As futures são polled por um runtime0 码力 | 389 页 | 1.05 MB | 10 月前3
Comprehensive Rust(Ukrainian) 20241263.1 async/await . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362 63.2 Futures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363 63.3 Середовища потоків і м'ютексів), так і async/await конкурентність (кооперативна багатозадачність з використанням futures). 11 За рамками курсу Rust це об'ємна мова, і ми не зможемо охопити її за кілька днів. Теми, що 10 хвилин Futures 4 хвилини Середовища виконання 10 хвилин Завдання 10 хвилин 63.1 async/await На високому рівні асинхронний код Rust дуже схожий на ”звичайний” послідовний код: use futures::executor::block_on;0 码力 | 396 页 | 1.08 MB | 10 月前3
Comprehensive Rust(Persian ) 20241264.1 async/await . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359 64.2 Futures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360 64.3 Runtimes . � � � mutex � � ( � async/await concurrency (multitasking � � � � � � � ( � � � � � � � � � � � futures � � � � � � � � � � � � � � � . 11 � � � � � � � � � � � � � � � � � � � � � � Rust , � � � � � � � � � � � � � � � � � � � � � � � � � � � � � . � � � � � � Rust asynchronous � � � � � � ” futures ” � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � . future0 码力 | 393 页 | 987.97 KB | 10 月前3
共 91 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10
相关搜索词
FromEagerFuturesPromisestoLazyContinuationsEvolvinganActorLibraryBasedonLessonsLearnedfromLargeScaleDeploymentsTornado6.5DocumentationSpannyRiseofstdmdspanDistributedRangesModelforBuildingDataStructuresAlgorithmsandViewsComprehensiveRustEnglish202412DEDUCINGthisPATTERNSPortugudoBrasilUkrainianPersian













