摘要
介绍了三种多线程环境下的Reactor模式的实现,分别是:开源网络库NMSTL、开源网络库Muduo以及作者基于Reactor模式实现的网络库。本文讨论了实现Reactor模式时,需要完成的定时器,为实现TCP通信需要实现的非阻塞连接器、接受器、读写操作等,对类对象生命周期的管理以及在多线程环境下使用时还需要进行的同步设计。
This paper introduces three kinds of implementation of Reactor mode in multi thread environment,which are: open source network library NMSTL,open source network library muduo and a network library based on the Reactor mode implemented by me. This paper discusses how to complete the timer,how to realize non- blocking connector,acceptor and read and write operation to realize TCP communication. This paper also describes the management of the life cycle of the class object and synchronous designs in multi thread environment.
作者
李璞
张玲
胡术
潘倩
李艳
LI Pu ZHANG Ling HU Shu PAN Qian LI Yan(Department of Computer, Sichuan University, Chengdu, 610064, China National Key Laboratory of Fundamental Science on Synthetic Vision, Sichuan University, Chengdu, 610064, China Computer Teaching Experiment Center, Sichuan University, Chengdu, 610064, China)
出处
《网络新媒体技术》
2017年第2期52-57,共6页
Network New Media Technology