Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resume multiple coroutines in parallel #55

Open
tickox opened this issue Jul 26, 2022 · 1 comment
Open

resume multiple coroutines in parallel #55

tickox opened this issue Jul 26, 2022 · 1 comment

Comments

@tickox
Copy link

tickox commented Jul 26, 2022

Hello,

I currently have asynchronous code with callback that I would potentially like to replace with fibers.
The operation is simple, I make a parallel for loop on an event list and I call the assigned callbacks functions.

With fibers, I would initially be on the thread with main_co and resume the coroutines with a parallel for loop, which can yield again (they cannot be resumed again on the same loop).

Is it possible ?
I suppose there must be synchronizations to do on the main_co when we resume, yield or exit.
I would normally have few fibers (about fifty).

Thanks

@hnes
Copy link
Owner

hnes commented Jul 27, 2022

Hi, I'm not sure whether I understood your question correctly. In test_aco_tutorial_6.c, there is a demo of a very naive scheduler. Yes, you may have to implement your own scheduler in this case. if I didn't understand your question correctly, a simple example of your question would be very helpful. Enjoy :-D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants