/**
Create a coroutine, then resume it asynchronous on current queue.
co_launch will run the block in next run loop
@param block the code execute in the coroutine
@return the coroutine instance
*/
框架没有为非主线程创建运行环。
对于没有运行环的线程,框架是直接对已有栈进行了保存与消除,运行完任务后,又恢复之前的栈。
而主线程具有运行环,的确是运行环驱动的任务调度。同样也进行了栈的消除与恢复。
/**
Create a coroutine, then resume it asynchronous on current queue.
co_launch will run the block in next run loop
@param block the code execute in the coroutine
@return the coroutine instance
*/
框架没有为非主线程创建运行环。
对于没有运行环的线程,框架是直接对已有栈进行了保存与消除,运行完任务后,又恢复之前的栈。
而主线程具有运行环,的确是运行环驱动的任务调度。同样也进行了栈的消除与恢复。