What are the differences between a \"coroutine\" and a \"thread\"?
12 Years late to the discussion but a coroutine has the explaination in the name. Coroutine can be decomposed into Co and Routine.
A routine in this context is just a sequence of operations/actions and by executing / processing a routine the sequence of operations gets executed one by one in the exact same order as specified.
Co stands for cooperation. A co routine is asked to (or better expected to) willingly suspend its execution to give other co-routines a chance to execute too. So a co-routine is about sharing CPU resources (willingly) so others can use the same resource as oneself is using.
A thread on the other hand does not need to suspend its execution. Being suspended is completely transparent to the thread and the thread is forced by underlying hardware to suspend itself. It is also done in a way so that it is mostly transparent to the thread as it does not get notified and it's state is not altered but saved and later restored when the thread is allowed to continue.
One thing that is not true, that co-routines can not be concurrently executed and race conditions can not occur. It depends on the system that the co-routines are running on and it is easy possible to imaging co-routines .
It does not matter how the co-routines suspend themselves. Back in Windows 3.1 int 03 was woven into any programs (or had to be placed in there) and in C# we add yield.