On Sat, Apr 13, 2013 at 3:22 PM, Vsevolod Dyomkin <vseloved@gmail.com> wrote:
On Sat, Apr 13, 2013 at 4:08 PM, Stig Hemmer <stighemmer@gmail.com> wrote:
Isn't coroutines trivial with threads?

I'm talking here about the cooperatively scheduled coroutines.

 So was I.  Sorry about being too short.

Threads and coroutines are not the same thing, obviously, but it seems to me that threads are powerful enough to be used to implement a coroutine library without a whole lot of effort.  You will need a some sort of locking to make sure only one thread is actually executing at any given time, but you will get independent call stacks for free.

I haven't really thought this through and there might be some trvial reason I am wrong.