Questions tagged [coroutines]
Used for questions involving coroutine functionality; either from the language itself, provided by an external library, or when the code in question implements coroutines itself.
24 questions
7
votes
2
answers
671
views
Minimal C++ Coroutine Scheduler with Sleep, Spawn, and Join Support
The following code implements a basic coroutine scheduler that can be polled from the main loop, providing a lightweight alternative to multithreading.
...
3
votes
1
answer
50
views
Kotlin coroutines in Jetpack Compose: Dispatcher-usage
I have implemented a timer in Jetpack Compose. It counts down a given amount of seconds. The remaining seconds are displayed. Moreover the past and remaining seconds are displayed as a circular graph. ...
4
votes
1
answer
79
views
Timer coroutine
I was trying to learn more about C++ 20 coroutines. After trying to read the documentation and watching few videos, I tried to write a timer that uses coroutines.
...
3
votes
0
answers
81
views
Bridging the gap between Spring's JdbcTemplate and Kotlin coroutines
I'm learning about Kotlin coroutines. I'm wondering if I can use them to increase the throughput of my spring-boot application which is currently very heavily dependent on jdbc connections, without ...
2
votes
1
answer
87
views
C++ CoRoutine Second Try building a range
Second try.
This time rather than get() and operator bool make the handle be a range operator.
The only difference in the ...
3
votes
2
answers
105
views
C++ CoRoutine First Try
Lazy range generator.
I know everybody's first example for co-routines.
But want to get some feedback.
The code
...
3
votes
1
answer
85
views
Consuming each Kafka partition in a separate proccess
I'm reimplementing functionality originally written in Kotlin. It uses Dispatchers.Default which is recommended for CPU-intensive tasks like JSON parsing to start ...
2
votes
1
answer
124
views
Kotlin Compose authentication with Google and Facebook using a CircularProgressIndicator for UI loading
I had this problem: https://stackoverflow.com/questions/78528358/how-to-prevent-circularprogressindicator-from-freezing-during-authentication-in
Now after fixing it, I want to make sure that this is ...
5
votes
1
answer
164
views
Sorting songs with the ability to save and resume partial sorts
I listen to a lot of music (~4k h/y) and managing thousands of songs is a bit of a challenging.
To improve my listening experience I want to better organize my collection.
One thing I want to do is ...
4
votes
1
answer
492
views
Single threaded epoll based coroutine library for C++, Linux
I've implemented a small single-header library over the C++20 coroutines. This library only works on a single thread and it is limited to Linux because it is also based on epoll.
The library does not ...
2
votes
1
answer
122
views
sendmsg() scatter-gather coroutine awaiter, optimized suspending
My attempt at an Awaiter for sending scatter-gather data over an open file descriptor. Tested only on gcc-13.1.1
Micro-optimizing by suspending the coroutine only ...
2
votes
2
answers
134
views
Finding files using multiple coroutines
I'm trying to write a simple program to find a certain file name within a directory tree. I use up to 30 coroutines.
Is there anything wrong with this code or what needs to be improved?
...
5
votes
0
answers
213
views
Single-threaded coroutine in C (Linux x86-64)
Background Story
I crafted a simple single-threaded coroutine in C, running on Linux x86-64.
Short Technical Explanation
1) Task
There are two types of tasks in this implementation.
Main task. This ...
5
votes
1
answer
414
views
C++20 Coroutine Task
This project is the natural extension to my attempt to make a templatedgenerator coroutine. This time, I tried what I called a "...
6
votes
2
answers
4k
views
C++20 Coroutine Generator
Here is a coroutine generator class... Just like Python yields. It was a bit tedious to support both co_yield and co_return (...