#coroutine
i got suspended for yielding from my coroutine
November 15, 2025 at 6:53 PM
Idea is to remove the old coroutine stuff in the viewer and use yieldable work graphs that can be scattered across threads as needed. Then start replacing various bits where we do a bunch of work on the main thread that we could actually do on another thread, and just "callback" to the main thread.
November 15, 2025 at 7:54 PM
and then there's public void StartStabbing() that starts the coroutine with the right params so that it can be called from another controller script... you are so seen rn
November 10, 2025 at 7:11 PM
would be nice if, say, inner code could just yield some DataRequest plain data (e.g. arguments to query a database with), then have the outer module pass that over to some other coroutine that does queries, then have that yield the query result back up, then .send() it back down to the 1st generator
November 14, 2025 at 2:21 PM
Wow Rust coroutines are cool!
My little `f(x) { prefetch(x); yield; compute(x); }` benchmark is ~8ns per call with explicit prefetching in a loop, and ~9ns per call when using coroutine abstractions :)

(I first spent a full day struggling with async, which I only got down to 14ns with much pain.)
November 7, 2025 at 9:58 AM
yeah, the underlying problem is inherent to a LIFO mutex. what i think is more novel here is just that it is a way that Rust’s async primitives give you a neat little way to have acquired a lock in a suspended coroutine without realizing you haven’t released the lock
November 1, 2025 at 12:11 AM
You know you need a break from game development when you call a coroutine wrong and wonder why nothing is happening 😭😂
Should I even dare to make a devlog lol😝
Yes I do 🤭
#gamedev
October 19, 2025 at 9:16 PM
Day 4 of #CosmicHorrorsJam and I've got gameplay! And a name! Godscrown! This has been incredibly quick to develop thanks to Godot's coroutine and signal stuff!

#indiegamedev #cardgame #screenshotsaturday #yesiknowimadaylate #godot #art
October 13, 2025 at 5:51 AM
Channel: messages are shared out so that each message is received by exactly one consumer.

Shared flow: messages are replicated so that each consumer receives its own copy of every message.

#kotlin #coroutine tips 💡

The diagram is from 📚 Kotlin Coroutine Confidence 👉 pragprog.com/titles/...
September 21, 2025 at 7:28 AM
I breathe in logic
Speak in threads
Forget where one of us ends

Track #6 - Coroutine

Iris Lucid Overdrive
Now also on IHeartRadio

irislucid.bandcamp.com/album/iris-l...

#newmusic #cyberpunk #neuromancer
September 17, 2025 at 6:29 PM
Tip to tell suspending functions and coroutines apart in Kotlin:

💡👉 Think of a suspending function as the script for a play, and a coroutine as the performance. 🎭

Every chapter in my book 📚 Kotlin Coroutine Confidence ends with a "Key Concepts" recap to help you remember what you've learned 👍
September 16, 2025 at 10:40 AM
ありがとうございます。なるほど。たぶん、この質問を先にすべきだったのですが、root coroutineってなんでしょうか?そして、このドキュメントはなぜわざわざ「root coroutineを作るときは」という条件をつけているのでしょう。つまり root と non-root で挙動が変わるということかなと思っていたのですが、そこが違いますか?

たぶん、これ以上は daruma さんのお時間を無駄に奪うことになるので、自分で実装を読みますね。理解が遅くてすみません m(_ _)m

kotlinlang.org/docs/excepti...
November 2, 2023 at 6:44 AM
if you have time for some more advanced topics you can also try and introduce coroutine accessors. these are shipping to prod i believe q2 or q3 2025. this can be the defense against the "accidental quadratic" problem when building copy-on-write semantics.

forums.swift.org/t/pitch-modi...
[Pitch] Modify and read accessors
Hi Swift evolution, We are proposing modify and read accessors for properties and subscripts. The proposal would formalize the underscored _modify and _read accessors that have been unofficially ava...
forums.swift.org
December 13, 2024 at 12:11 AM
Is there a way to get something like a sequential DispatchQueue in Swift on Android (Kotlin)?

It seems a bit odd to have to block on a mutex *inside* a coroutine to ensure they run in order, instead of somehow restricting the coroutine to wait for the previous one to complete its run […]
Original post on chaos.social
chaos.social
February 17, 2025 at 11:58 AM
Show HN: Neco – Coroutine Library for C (@github.com)

Main Link | Discussion
April 10, 2024 at 2:00 AM
AAAAaaaaa meu código inteiro foi escrito com coroutine agora tenho de voltar pra FixedUpdate eu quero DESTRUIÇÃO FÚRIA ÓDIO MORTE VIOLÊNCIA
March 16, 2025 at 5:08 PM
これだけ10年以上同じアプリをメンテ・拡張し続けてると、凄腕エンジニアさんにコードレビューしてもらいたくなるなあ、って数年前から思ってたんだよね。特にアーキテクチャがここ数年大きく変わってきているので(CoroutineとかViewModelとかComposeとか)その導入っぷりも含めてレビューしてもらいたかったんだけど、今やAIエージェントにうまく頼めば評価してもらえるんだよね。ここ半年ほどでAndroid界隈も一気に生成AI/AIエージェントが使えるようになってきて劇的に変わってる。わけがわからない。
June 27, 2025 at 5:00 PM
yeah i feel like a memory-safe C runtime would be better than go. and one non-shit coroutine library
June 19, 2025 at 12:38 AM
right now though i'm super enjoying that Unity's coroutine functionality just accepts a generator and for each step it pauses until the next frame. makes it incredibly easy to run code that updates every frame like animations and such
August 13, 2025 at 9:05 PM
When you call setContent in an Activity or Fragment, Compose creates a Recomposer backed by the main thread.

It then launches a coroutine that drives the recomposition loop by calling runRecomposeAndApplyChanges
May 12, 2025 at 8:44 PM
- ownership: in my case the task type or promise type of result of the coroutine
- nested coroutines if they are waiting for result are not scheduled unless nested coroutine finished
- when you co_await on task, you mark dependency (by putting handle to promise type of awaited task to be resumed)
May 3, 2025 at 9:03 AM
A memory safe C framework, RAII, I/O, coroutine and other concurrency primitives

https://zelang-dev.github.io/c-asio/
August 1, 2025 at 1:30 AM
Unlocking the Power of Coroutine Workers: A Comprehensive Guide As the world of software development continues to evolve, the need for efficient and scalable solutions has become increasingly impor...

#Troubleshooting #Guides

Origin | Interest | Match
Unlocking the Power of Coroutine Workers: A Comprehensive Guide
As the world of software development continues to evolve, the need for efficient and scalable solutions has become increasingly important. One concept that has gained significant attention in recent years is coroutine workers. In this article, we will delve into the world of coroutine workers, exploring what they are, how they work, and the benefits they offer. Table of Contents Toggle * Introduction to Coroutine Workers * What are Coroutines? * How do Coroutine Workers Work? * Key Components of Coroutine Workers * Benefits of Coroutine Workers * Improved Responsiveness * Increased Throughput * Real-World Applications of Coroutine Workers * Implementing Coroutine Workers * Python’s asyncio Library * Java’s Project Loom * Best Practices for Implementing Coroutine Workers * Conclusion * What are coroutine workers and how do they improve system performance? * How do coroutine workers differ from traditional threading approaches? * What are the benefits of using coroutine workers in I/O-bound applications? * How do coroutine workers handle errors and exceptions? * Can coroutine workers be used with other concurrency models, such as threads and processes? * What are the best practices for using coroutine workers in production systems? * How do coroutine workers impact the debugging and testing of concurrent systems? ## Introduction to Coroutine Workers Coroutine workers are a type of programming construct that allows for the creation of concurrent and asynchronous code. They are designed to handle tasks that require waiting or blocking, such as I/O operations or network requests, without blocking the main thread of execution. This enables developers to write more efficient and scalable code, capable of handling a large number of concurrent tasks. ### What are Coroutines? Before diving into coroutine workers, it’s essential to understand what coroutines are. Coroutines are a type of function that can suspend and resume its execution at specific points, allowing other coroutines to run in the meantime. This is in contrast to traditional functions, which run to completion before returning control to the caller. Coroutines are often used to implement cooperative multitasking, where tasks yield control to other tasks at specific points, allowing for efficient and lightweight concurrency. ### How do Coroutine Workers Work? Coroutine workers are built on top of the coroutine concept. They provide a way to run coroutines concurrently, allowing developers to write asynchronous code that is efficient and scalable. When a coroutine worker is created, it is assigned a task to execute, which can be a coroutine or a traditional function. The worker then runs the task, suspending and resuming its execution as needed, to allow other tasks to run. #### Key Components of Coroutine Workers There are several key components that make up a coroutine worker: * **Coroutine scheduler** : This is the component responsible for scheduling coroutines to run. It determines which coroutines to run, and when to suspend and resume their execution. * **Task queue** : This is a data structure that holds the tasks to be executed by the coroutine worker. Tasks are added to the queue and removed as they are completed. * **Worker thread** : This is the thread that runs the coroutine worker. It is responsible for executing the tasks in the task queue. ## Benefits of Coroutine Workers Coroutine workers offer several benefits, making them an attractive solution for developers looking to write efficient and scalable code. Some of the key benefits include: Coroutine workers provide a way to write concurrent and asynchronous code that is efficient and scalable. They allow developers to handle a large number of concurrent tasks, without the need for complex threading or synchronization mechanisms. This makes them ideal for applications that require high levels of concurrency, such as web servers, network servers, and real-time systems. ### Improved Responsiveness Coroutine workers can improve the responsiveness of an application by allowing it to handle tasks concurrently. This means that the application can respond to user input and events in a timely manner, even when performing long-running tasks. ### Increased Throughput Coroutine workers can increase the throughput of an application by allowing it to handle multiple tasks concurrently. This means that the application can process more tasks in a given amount of time, making it more efficient and scalable. #### Real-World Applications of Coroutine Workers Coroutine workers have a wide range of real-world applications, including: Application| Description ---|--- Web servers| Coroutine workers can be used to handle multiple HTTP requests concurrently, improving the responsiveness and throughput of the server. Network servers| Coroutine workers can be used to handle multiple network connections concurrently, improving the responsiveness and throughput of the server. Real-time systems| Coroutine workers can be used to handle multiple tasks concurrently, improving the responsiveness and throughput of the system. ## Implementing Coroutine Workers Implementing coroutine workers requires a good understanding of the underlying concepts and technologies. There are several libraries and frameworks available that provide support for coroutine workers, including Python’s asyncio library and Java’s Project Loom. ### Python’s asyncio Library Python’s asyncio library provides a high-level API for writing concurrent and asynchronous code. It includes support for coroutine workers, making it easy to write efficient and scalable code. ### Java’s Project Loom Java’s Project Loom is a library that provides support for coroutine workers. It includes a high-level API for writing concurrent and asynchronous code, making it easy to write efficient and scalable code. #### Best Practices for Implementing Coroutine Workers When implementing coroutine workers, there are several best practices to keep in mind: * **Use a high-level API** : Using a high-level API can make it easier to write concurrent and asynchronous code. * **Avoid low-level threading** : Low-level threading can be complex and error-prone. Instead, use a high-level API that provides support for coroutine workers. * **Test thoroughly** : Testing is essential when writing concurrent and asynchronous code. Make sure to test your code thoroughly to ensure it works as expected. ## Conclusion Coroutine workers are a powerful tool for writing efficient and scalable code. They provide a way to handle concurrent and asynchronous tasks, improving the responsiveness and throughput of an application. By understanding the concepts and technologies behind coroutine workers, developers can write high-quality code that meets the needs of modern applications. Whether you’re building a web server, network server, or real-time system, coroutine workers are definitely worth considering. With their ability to improve responsiveness, increase throughput, and simplify concurrent programming, coroutine workers are an essential tool for any developer looking to write efficient and scalable code. ## What are coroutine workers and how do they improve system performance? Coroutine workers are lightweight threads that can be used to execute tasks concurrently, improving the overall performance and responsiveness of a system. By utilizing coroutines, developers can write asynchronous code that is much simpler and more efficient than traditional threading approaches. This is because coroutines are designed to yield control back to the caller at specific points, allowing other coroutines to run and making efficient use of system resources. The use of coroutine workers can significantly improve system performance by enabling tasks to be executed in parallel, reducing the time spent waiting for I/O operations to complete, and increasing the throughput of the system. Additionally, coroutine workers can help to improve system responsiveness by allowing tasks to be executed in the background, freeing up the main thread to handle user input and other high-priority tasks. By leveraging coroutine workers, developers can create systems that are more scalable, efficient, and responsive, providing a better experience for users. ## How do coroutine workers differ from traditional threading approaches? Coroutine workers differ from traditional threading approaches in several key ways. Firstly, coroutines are much lighter in weight than threads, requiring fewer system resources to create and manage. This makes them ideal for systems where thousands or even millions of concurrent tasks need to be executed. Secondly, coroutines are designed to be cooperative, yielding control back to the caller at specific points, whereas threads are typically preemptive, relying on the operating system to schedule and interrupt them. The cooperative nature of coroutines makes them much easier to work with than threads, as developers do not need to worry about synchronization primitives, such as locks and semaphores, to protect shared data. Instead, coroutines can be designed to communicate with each other using high-level abstractions, such as channels and queues, making it easier to write concurrent code that is correct and efficient. Overall, the use of coroutine workers provides a more efficient, scalable, and easier-to-use alternative to traditional threading approaches, making it an attractive option for developers building concurrent systems. ## What are the benefits of using coroutine workers in I/O-bound applications? The use of coroutine workers in I/O-bound applications, such as web servers and databases, can provide significant benefits in terms of performance and scalability. By using coroutines to handle I/O operations, such as reading and writing to files, networks, and databases, developers can write asynchronous code that is much simpler and more efficient than traditional threading approaches. This is because coroutines can yield control back to the caller while waiting for I/O operations to complete, allowing other coroutines to run and making efficient use of system resources. The benefits of using coroutine workers in I/O-bound applications include improved responsiveness, increased throughput, and better resource utilization. By handling I/O operations asynchronously, coroutine workers can reduce the time spent waiting for I/O operations to complete, allowing the system to handle more requests and improve overall throughput. Additionally, coroutine workers can help to improve system responsiveness by allowing tasks to be executed in the background, freeing up the main thread to handle user input and other high-priority tasks. Overall, the use of coroutine workers in I/O-bound applications can provide significant benefits in terms of performance, scalability, and responsiveness. ## How do coroutine workers handle errors and exceptions? Coroutine workers handle errors and exceptions in a way that is similar to traditional threading approaches, but with some key differences. When an error or exception occurs in a coroutine, it is propagated up the call stack, just like in a traditional thread. However, because coroutines are designed to yield control back to the caller at specific points, errors and exceptions can be handled in a more centralized way, making it easier to write robust and fault-tolerant code. The use of coroutine workers provides several benefits when it comes to handling errors and exceptions. Firstly, coroutines can be designed to handle errors and exceptions in a way that is specific to the task being executed, making it easier to write code that is robust and fault-tolerant. Secondly, coroutine workers can provide a more centralized way of handling errors and exceptions, making it easier to write code that can recover from failures and continue executing. Overall, the use of coroutine workers provides a more efficient, scalable, and easier-to-use way of handling errors and exceptions, making it an attractive option for developers building concurrent systems. ## Can coroutine workers be used with other concurrency models, such as threads and processes? Yes, coroutine workers can be used with other concurrency models, such as threads and processes. In fact, coroutine workers are designed to be used in conjunction with other concurrency models, providing a way to execute tasks concurrently at a finer granularity than threads or processes. By using coroutine workers in conjunction with threads or processes, developers can create systems that are more scalable, efficient, and responsive, providing a better experience for users. The use of coroutine workers with other concurrency models provides several benefits. Firstly, coroutine workers can be used to execute tasks that are too small to be executed in a separate thread or process, making it easier to write concurrent code that is efficient and scalable. Secondly, coroutine workers can be used to handle I/O operations and other tasks that are blocking, allowing threads or processes to be used for compute-bound tasks. Overall, the use of coroutine workers with other concurrency models provides a more efficient, scalable, and easier-to-use way of building concurrent systems, making it an attractive option for developers. ## What are the best practices for using coroutine workers in production systems? The best practices for using coroutine workers in production systems include designing coroutines to be cooperative, using high-level abstractions to communicate between coroutines, and handling errors and exceptions in a centralized way. Additionally, developers should consider the trade-offs between using coroutine workers and other concurrency models, such as threads and processes, and choose the approach that best fits the needs of their system. By following these best practices, developers can create production systems that are more scalable, efficient, and responsive, providing a better experience for users. The use of coroutine workers in production systems requires careful consideration of several factors, including performance, scalability, and reliability. Developers should consider the overhead of creating and managing coroutines, as well as the benefits of using coroutine workers to execute tasks concurrently. Additionally, developers should consider the need for synchronization and communication between coroutines, and choose the abstractions and APIs that best fit the needs of their system. By carefully considering these factors and following best practices, developers can create production systems that are more efficient, scalable, and responsive, making it an attractive option for building concurrent systems. ## How do coroutine workers impact the debugging and testing of concurrent systems? Coroutine workers can impact the debugging and testing of concurrent systems in several ways. Firstly, the use of coroutine workers can make it more difficult to debug and test concurrent systems, as the execution of tasks is non-deterministic and may involve multiple coroutines executing concurrently. Secondly, the use of coroutine workers requires developers to use specialized tools and techniques to debug and test concurrent systems, such as coroutine-aware debuggers and testing frameworks. The use of coroutine workers requires developers to adopt new strategies for debugging and testing concurrent systems. Firstly, developers should use logging and tracing to understand the execution of coroutines and identify potential issues. Secondly, developers should use testing frameworks that are designed to work with coroutine workers, such as those that provide support for testing concurrent code. Additionally, developers should consider the use of model checking and other formal verification techniques to prove the correctness of concurrent systems. By adopting these strategies, developers can ensure that their concurrent systems are correct, efficient, and reliable, making it an attractive option for building concurrent systems.
softhandtech.com
November 11, 2025 at 10:10 PM
aaand oops that's just a very basic subtype of async runtime isn't it.
yield/generator.send() letting you pause a coroutine to request more data from its caller is very interesting but the ergonomics of it seem...dubious in practice. Still, that's when i realized what a can of worms this all was
November 14, 2025 at 2:21 PM
fun fact: i didn't know any lua at all when implementing the lua scripting system into wega's challenge 2 deluxe initially, so it had a full custom coroutine system that barely worked before i realized the interpreter i was using natively supported them anyway :3
November 30, 2024 at 7:46 PM