Coroutines in C#
Posted
by eyal
on Stack Overflow
See other posts from Stack Overflow
or by eyal
Published on 2010-04-08T11:20:50Z
Indexed on
2010/04/08
11:23 UTC
Read the original article
Hit count: 535
I am looking to implement co-routines (user schedualed threads) in c#. When using c++ I was previously using fibers. As I see on the internet fibers do not exist in C#. I would like to get simillar functionality.
Is there any "right" way to implement coroutines in c#?
I have thought of implementing this using threads that aqcuire a single exection mutex + 1 one schedualer thread which releases this mutex for each coroutine. But this seems very costly (it forces a context switch between each coroutine)
I have also seen the yeild iterator functionality, but as I understand you can't yeild within an internal function (only in the original ienumerator function). So this does me little good.
© Stack Overflow or respective owner