Skip to main content
Filter by
Sorted by
Tagged with
1 vote
4 answers
96 views

There is something I can't understand in this code import asyncio async def fetch_data(param): print(f"Do something with {param}...") await asyncio.sleep(param) print(f"Done ...
M a m a D's user avatar
  • 2,189
5 votes
1 answer
385 views

I am trying to use coroutines with Qt. Here's minimal(I guess) example to reproduce my problem Basically, bellow code is adopted from the example of cppreference here: https://en.cppreference.com/w/...
slyx's user avatar
  • 2,326
2 votes
0 answers
67 views

I'm trying to understand how memory is used in my async Python application. I have multiple coroutines running, and I want to see how much memory each one is using, especially when they are nested or ...
Optidev's user avatar
  • 218
1 vote
0 answers
112 views

I'm writing some test code using Boost.Asio with C++20 coroutines. Working version (manual cleanup, non-RAII) The following code works as expected. Cleanup is always called, even when an exception is ...
Takatoshi Kondo's user avatar
1 vote
0 answers
90 views

I am trying to write a scheduler for a virtual computer that runs Lua and is transparent to the user (i.e.; no coroutine. yields needed) and would still like the user to be able to create coroutines ...
RRKS101_1 TF2's user avatar
3 votes
1 answer
107 views

In GCC 15, std::noop_coroutine's definition is { return std::noop_coroutine_handle(); } std::noop_coroutine_handle is defined by: using noop_coroutine_handle = std::coroutine_handle<std::...
shynur's user avatar
  • 505
-7 votes
1 answer
267 views

I would like to know whether Cgo implementing functions are allowed to arbitrarily manipulate the stack pointer. The motivation for this is to allow the use of coroutines on the C side of the call. ...
Hammdist's user avatar
  • 214
0 votes
1 answer
55 views

I want to modify this log helper function to print out coroutine id or name. @JvmInline value class MyLogger(private val tag: String) { fun log(level: Level, e: Throwable? = null, ...
Cindy's user avatar
  • 273
1 vote
1 answer
93 views

I am currently running a C++ program in which I have used the heap to simulate the stack and employed assembly language to place relevant information (such as memory addresses) into registers, thereby ...
qingfu liu's user avatar
1 vote
1 answer
64 views

I am profiling some code using the cppgraphgqlgen library - which uses C++20 coroutines extensively in its internals. I have profiled an application and found that I have some called-into methods that ...
Andrew Lipscomb's user avatar
1 vote
3 answers
127 views

I have a code: import asyncio as aio async def coro(future: aio.Future): print('Coro start') await aio.sleep(3) print('Coro finish') future.set_result('coro result') async def main(): ...
IzaeDA's user avatar
  • 439
0 votes
0 answers
48 views

I'm struggling with running python-telegram-bot-21.10 as a coroutine to a PyQt5 application using Python-3.12.7 (intended to run on a Raspberry Pi). I had this setting operating for some years now ...
blue14's user avatar
  • 56
2 votes
1 answer
55 views

In Lua, I can define a member function like this: Foo = {} function Foo:bar() ... end I realise this is just syntactic sugar for this: Foo = {} foo.bar = function(self) ... end Is there a way ...
Tom's user avatar
  • 8,171
2 votes
1 answer
117 views

It is often said that coroutines could be thought of as "light threads" because they consume less memory. However, I wasn't able to find any explanation on why exactly that is the case. What ...
DiplomateProgrammer's user avatar
1 vote
1 answer
139 views

I want to know a method to pass values from the caller to the coroutine. My idea: Any awaiter type must provide a await_resume() function. This function can return something to the co_await inside ...
Klaus's user avatar
  • 26k
0 votes
0 answers
96 views

So far the best I've come up with is a wrapper function for every function, like this: template<class A, class B> coro<var> operator+(A && a, B && b) { return [] (A a, ...
kylefinn's user avatar
  • 2,423
2 votes
0 answers
154 views

I try to implement a simple coroutine using c. The platform is: M3 Pro MacBook Pro 16 apple native gcc macOS 14.3.1 Here is my code: // main.c #include <stdio.h> #include <stdlib.h> #...
JasonZhang's user avatar
2 votes
2 answers
114 views

godbolt: https://godbolt.org/z/6avWcGqKv The following code, compiled and run with g++ 12, 13, 14, all give the same (wrong?) output. clang 18, 19 are fine (all "done: 1"). As far as I ...
Ralph Zhang's user avatar
  • 5,443
1 vote
1 answer
51 views

I have a very simple coroutine example to understand basics. However, I am stuck to understand why the done method of the handle object still returns false. I call resume and there is no more co_await ...
Cabbas's user avatar
  • 101
0 votes
1 answer
162 views

In this code: private suspend fun doSthSingleThreaded(){ coroutineScope { //Coroutine 1 launch { //do sth that will suspend } //Coroutine 2 ...
khebrati's user avatar
  • 100
1 vote
0 answers
42 views

While diving into Android/Kotlin development, I learned that the suspend keyword transforms the function into a state machine that can be removed from its executing thread, put on hold, and resumed at ...
ErnestV's user avatar
  • 137
1 vote
3 answers
104 views

I have var DICTIONARY, which is a dictionary where the keys are English letters and the values are words that start with the corresponding letter. The initial filling of DICTIONARY looks like this: ...
ERJAN's user avatar
  • 24.6k
0 votes
0 answers
43 views

I have a really weird bug where I have a function that resets my whole room. First, it clears the previous grids if they exist. Then, it generates lists of lists of vectors, which work as grids. Then ...
MarcosT's user avatar
0 votes
1 answer
75 views

I have class MyViewModel(private val activitiesRepo: ActivitiesRepo) : ViewModel() { val activities = mutableStateListOf<Activity>() private var activitiesFlow = activitiesRepo....
wuujcik's user avatar
  • 66
3 votes
1 answer
92 views

I am new to corotine and asio. I am working on a local process management tool where a client is responsible for launching a program. This client sends commands to a backend daemon that manages the ...
Jarviswu's user avatar

1
2 3 4 5
48