Tokio源码阅读记录
lib.rs主要是说Tokio的一些feature,其中默认带的是async_read和async_write,其他很多都需要手动打开一些feature,例如net,std_io,runtime等等。然后就是平台的介绍,目前保证支持的有这些 Linux Windows Android (API level 21) macOS iOS FreeBSD Runtimemod.rs总览多线程和单线程Runtime的new runtime::Runtime::new() 新建一个运行时,默认为多线程,需要开启’rt-multi-thread’ runtime::Builder::new_current_thread() 新建一个运行在当前线程上的运行时 资源驱动 Resouece driversTokio提供了Builder::enable_io和Builder::enable::enable_time以及Builder::enable_all来开启资源驱动 一些关于调度时的参数 MAX_TASKS ...