Coroutines (CloudMonk.io)

Coroutines



Return to Futures, Promises, Asynchronous Programming, Asynchrony, Asynchronous Programming Fundamentals

* What programming languages support Coroutines. Answer in MediaWiki syntax with the URL of the official documentation for each language reference.


Coroutines are programming constructs that generalize subroutines for non-preemptive multitasking, allowing execution to be suspended and resumed. They are used extensively in asynchronous programming to simplify the writing of non-blocking code and to efficiently handle concurrency. Below is a list of programming languages that support coroutines, formatted in MediaWiki syntax, including the URL of the official documentation for each language's coroutine support.

Python


Python supports coroutines through its `asyncio` library, enabling asynchronous I/O operations.
* Official Documentation: [https://docs.python.org/3/library/asyncio-task.html Python asyncio documentation]

Kotlin


Kotlin offers first-class support for coroutines, facilitating asynchronous programming and more.
* Official Documentation: [https://kotlinlang.org/docs/reference/coroutines-overview.html Kotlin Coroutines documentation]

Lua


Lua has coroutines as part of its standard library, allowing for cooperative multitasking in Lua programs.
* Official Documentation: [https://www.lua.org/pil/9.html Lua 5.1 Reference Manual: Coroutines]

C#


C# supports coroutines in the Unity game development engine through its MonoBehaviour framework, using the `yield` keyword.
* Unity Documentation: [https://docs.unity3d.com/Manual/Coroutines.html Unity: Coroutines]

JavaScript


While JavaScript does not have native coroutines, it uses async/await syntax, which can be considered similar to coroutines, for asynchronous operations.
* Official Documentation: [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function MDN Web Docs: async function]

Go


Go uses goroutines, which are similar to coroutines but are more lightweight and managed by the Go runtime. They are used for concurrent tasks.
* Official Documentation: [https://golang.org/doc/effective_go#goroutines Go: Effective Go - Goroutines]

Rust


Rust supports asynchronous programming with async/await, which can be used in a similar way to coroutines for non-blocking I/O operations.
* Official Documentation: [https://rust-lang.github.io/async-book/ Rust Async Book]

Swift


Swift introduced structured concurrency with Swift 5.5, including async/await syntax for asynchronous programming, similar to coroutines.
* Official Documentation: [https://docs.swift.org/swift-book/LanguageGuide/Concurrency.html Swift: Concurrency]

Scala


Scala supports coroutines through libraries, such as Scala Async, which provides non-blocking asynchronous programming.
* Library Documentation: [https://github.com/scala/scala-async Scala Async on GitHub]

PHP


PHP offers coroutines through the Swoole extension, enabling asynchronous and concurrent programming for PHP applications.
* Swoole Documentation: [https://www.swoole.co.uk/docs/modules/swoole-coroutine Swoole Coroutine]

Each of these languages or environments provides support for coroutines or similar constructs, enabling developers to write efficient, non-blocking, and concurrent code. The official documentation for each offers in-depth guides on how to effectively use coroutines or their equivalents within their respective programming paradigms.
----

Coroutines are computer program components that generalize subroutines for non-preemptive multitasking, by allowing execution to be suspended and resumed. Coroutines are well-suited for implementing familiar program components such as cooperative multitasking|cooperative tasks, exception handling|exceptions, event loops, iterators, lazy evaluation|infinite lists and pipeline (software)|pipes.

According to Donald Knuth, Melvin Conway coined the term coroutine in 1958 when he applied it to the construction of an assembly language|assembly program. The first published explanation of the coroutine appeared later, in 1963.



Error: File not found: wp>Coroutine

{{navbar_coroutines]]}
navbar_coroutines

Async Programming: Async Programming Best Practices, Asynchronous Programming Fundamentals, Promises and Futures, Async C, Async C++, Async C#, Async Clojure, Async Dart, Async Golang, Async Haskell, Async Java (RxJava), Async JavaScript, Async Kotlin, Async PowerShell, Async Python, Async Ruby, Async Scala, Async TypeScript, Async Programming Bibliography, Manning Concurrency Async Parallel Programming Series. (navbar_async - see also navbar_concurrency, navbar_python_concurrency, navbar_golang_concurrency, navbar_java_concurrency)

Concurrency: Concurrency Programming Best Practices, Concurrent Programming Fundamentals, Parallel Programming Fundamentals, Asynchronous I/O, Asynchronous programming (Async programming, Asynchronous flow control, Async / await), Asymmetric Transfer, Akka, Atomics, Busy waiting, Channels, Concurrent, Concurrent system design, Concurrency control (Concurrency control algorithms‎, Concurrency control in databases, Atomicity (programming), Distributed concurrency control, Data synchronization), Concurrency pattern, Concurrent computing, Concurrency primitives, Concurrency problems, Concurrent programming, Concurrent algorithms, Concurrent programming languages, Concurrent programming libraries‎, Java Continuations, Coroutines, Critical section, Deadlocks, Decomposition, Dining philosophers problem, Event (synchronization primitive), Exclusive or, Execution model (Parallel execution model), Fibers, Futures, Inter-process communication, Linearizability, Lock (computer science), Message passing, Monitor (synchronization), Computer multitasking (Context switch, Pre-emptive multitasking - Preemption (computing), Cooperative multitasking - Non-preemptive multitasking), Multi-threaded programming, Multi-core programming, Multi-threaded, Mutual exclusion, Mutually exclusive events, Mutex, Non-blocking algorithm (Lock-free), Parallel programming, Parallel computing, Process (computing), Process state, Producer-consumer problem (Bounded-buffer problem), Project Loom, Promises, Race conditions, Read-copy update (RCU), Readers–writer lock, Readers–writers problem, Recursive locks, Reducers, Reentrant mutex, Scheduling (computing)‎, Semaphore (programming), Seqlock (Sequence lock), Serializability, Shared resource, Sleeping barber problem, Spinlock, Synchronization (computer science), System resource, Thread (computing), Tuple space, Volatile (computer programming), Yield (multithreading) , Degree of parallelism, Data-Oriented Programming (DOP), Functional and Concurrent Programming, Concurrency bibliography, Manning Concurrency Async Parallel Programming Series, Concurrency glossary, Awesome Concurrency, Concurrency topics, Functional programming. (navbar_concurrency - see also navbar_async, navbar_python_concurrency, navbar_golang_concurrency, navbar_java_concurrency)

----



Cloud Monk is Retired (impermanence |for now). Buddha with you. Copyright | © Beginningless Time - Present Moment - Three Times: The Buddhas or Fair Use. Disclaimers



SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.



----