Coroutines in KotlinCoroutines in Kotlin Andrey.Breslav@JetBrains.com This talk could have been named… • async/await/yield • fibers • [stackless] continuations Suspendable Computations Outline • Motivation/Examples languages • Kotlin’s Solution – Client code – Library code • Compiling Coroutines • Exception Handling • Appendix. Serializable Coroutines? “Legal” • All I’m saying is no more final than Valhalla J val image flexibility for library designers – with minimal runtime support – and no macros J Flavors of Coroutines Stackless Stackful Language restrictions Use in special contexts L Use anywhere J Implemented0 码力 | 39 页 | 1.01 MB | 1 年前3
From Functions to CoroutinesFrom Functions to Coroutines 40 Years Evolution Rainer Grimm Training, Coaching, and Technology Consulting www.ModernesCpp.netEvolution of Callable templateT invoke(Func 0 码力 | 29 页 | 510.47 KB | 6 月前3
Deciphering C++ Coroutines2/55 Deciphering Coroutines - Part 2 Mastering Asynchronous Control Flow Andreas Weis CppCon 20243/55 About me - Andreas Weis (he/him) ComicSansMS cpp@andreas-weis.net Co-organizer of the Munich best-practice talk.16/55 A mental model for coroutines: Cooperative Threads void spawn_task () { // ... Result r = outer_function (); }16/55 A mental model for coroutines: Cooperative Threads void spawn_task mental model for coroutines: Cooperative Threads PartialResult middle_function () { auto r = inner_function (); return PartialResult :: from_io_result (r); }16/55 A mental model for coroutines: Cooperative0 码力 | 156 页 | 1.79 MB | 6 月前3
Coroutines and Structured Concurrency in PracticeChallenges when onboarding coroutines A lot of existing code mostly callback-based A custom-built I/O event loop predates Asio by a decade fine-tuned for specific use cases Somewhat conservative conservative audience real benefit needs to be demonstrated to justify switchingCallbacks vs coroutines // read length auto len = make_unique(); async_read(socket, buffer(len.get(), sizeof(int32_t)) use_awaitable); // ...handle data... Local variable Manual lifetime managementCallbacks vs coroutines // read length auto len = make_unique (); async_read(socket, buffer(len.get(), sizeof(int32_t)) 0 码力 | 103 页 | 1.98 MB | 6 月前3
How Meta Made Debugging Async Code Easier with Coroutines and Senders0 码力 | 131 页 | 907.41 KB | 6 月前3
Behavioral Modeling in HW/SW Co-design Using C++ CoroutinesJeffrey E. Erickson cppcon 2023 1cppcon 2023 Behavioral Modeling in HW/SW Co-design using C++ coroutines Jeffrey E Erickson, Ph.D. Sebastian Schönberg, Ph.D.© 2023 Intel Corporation and Jeffrey E. Erickson Jeffrey E. Erickson cppcon 2023 8 Coroutines are an enabling language feature • To date, coroutines have been about execution and workloads • In the modeling context, coroutines… • Provide syntactic sugar Handle parallelism in a way that isn’t clunky • Scale across large and complex HW interactions But, coroutines lack comprehensive standard library support • We used concurrencppIntel Confidential Department0 码力 | 44 页 | 584.69 KB | 6 月前3
Coroutine Patterns and How to Use Them: Problems and Solutions Using Coroutines in a Modern Codebaseknowledge Francesco Zoffoli - Coroutine Patterns and How to Use Them - CppCon 2023 5Motivation Coroutines introduce new paradigm Francesco Zoffoli - Coroutine Patterns and How to Use Them - CppCon 2023 CppCon 2023 11Overview – Executor • Executes synchronous functions • Could be multi-threaded • Coroutines are split in synchronous functions Francesco Zoffoli - Coroutine Patterns and How to Use Them CppCon 2023 19 [1] https://ericniebler.com/2020/11/08/structured-concurrency/Lifetime Member coroutines implicitly capture this Francesco Zoffoli - Coroutine Patterns and How to Use Them - CppCon0 码力 | 70 页 | 1.45 MB | 6 月前3
Kotlin Language Documentation 1.9.20longer period Kotlin/JVM Kotlin/Native Kotlin/JS Kotlin Gradle plugin Standard library Tools Coroutines 1.6.0-RC Migrating to Kotlin 1.6.0 What's new in Kotlin 1.5.30 Language features Kotlin/JVM Stable JSON serialization Scripting and REPL Migrating to Kotlin 1.4.0 What's new in Kotlin 1.3 Coroutines release Kotlin/Native Multiplatform projects Contracts Capturing when subject in a variable JVM backend JavaScript backend Tools What's new in Kotlin 1.1 Table of contents JavaScript Coroutines (experimental) Other language features Standard library JVM Backend JavaScript backend Kotlin0 码力 | 1299 页 | 32.44 MB | 1 年前3
Kotlin 1.2 Language DocumentationDevelopment Using Kotlin for Android Development Kotlin JavaScript Overview Kotlin/Native for Native Coroutines for asynchronous programming and more Multiplatform Programming What's New in Kotlin 1.1 What's interoperability Kotlin/Native interoperability with Swift/Objective-C Kotlin/Native Gradle plugin Coroutines Table of contents Coroutine basics Table of contents Additional references Table of contents properties, help build powerful and easy-to-use abstractions. Scalability: Kotlin's support for coroutines helps build server-side applications that scale to massive numbers of clients with modest hardware0 码力 | 333 页 | 2.22 MB | 1 年前3
Kotlin Language Documentation 1.3Android Development Kotlin JavaScript Overview Kotlin/Native for Native Kotlin for Data Science Coroutines for asynchronous programming and more Multiplatform Programming What's New in Kotlin 1.1 What's Kotlin/Native interoperability with Swift/Objective-C CocoaPods integration Kotlin/Native Gradle plugin Coroutines Table of contents Additional references Coroutine Basics Cancellation and Timeouts Composing properties, help build powerful and easy-to-use abstractions. Scalability: Kotlin's support for coroutines helps build server-side applications that scale to massive numbers of clients with modest hardware0 码力 | 597 页 | 3.61 MB | 1 年前3
共 542 条
- 1
- 2
- 3
- 4
- 5
- 6
- 55













