协程 Coroutine
A coroutine is a function that can suspend its execution (yield) until the given given YieldInstruction finishes.
感觉意思就是用户定义的伪多线程(同多线程对业务逻辑所需的功能特点)。操作系统只规定了进程和线程。就是说,我一个线程的任务理应业务逻辑是一条线,但是我为了实现多个任务,切换执行,但是线程还是一条线,只是我改变了这条线的传统逻辑,操作系统不需要知道,
tornado中的协程是如何工作的
协程定义
Coroutines are computer program components that generalize subroutines for nonpreemptive multitasking, by allowing multiple entry points for suspending and resuming execution at certain locations.。 —— [ 维基百科 ]
我们在平常编程中,更习惯使用的是