1.Nodejs是一个平台,构建在chrome的V8上(js语言解释器),采用事件驱动.非阻塞模型( c++库:libuv). 参考官方: Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that make…
#1.生产者和消费者模型producer and consumer modelimport timedef producer(): ret = [] for i in range(2): time.sleep(0.2) ret.append("包子%s" %i) return retdef consumer(res): for index,baozi in enumerate(res): time.sleep(0.2) print("第%s个人,吃了%s" %(in…