摘要
探讨了Linux平台下多线程技术和套接字网络通讯问题,在此基础上利用互斥锁和条件变量技术设计了一个面向连接的多线程并发服务器的详细算法。最后给出了基于Posix线程库的Linux系统下用C++实现多线程并发服务器的基本程序框架。实际项目应用表明这种基于多线程的并发服务器结构在完善程序功能的同时还可以有效提高其服务性能。
The paper discusses the techniques of multithread and the socket communication under the Linux platform. Then, based on mutual exclusion and condition variables, a detailed algorithm to implement the connection - oriented multithread concurrent server is given. Finally, the basic program frame to implement multithread concurrent server with C ++ language under Linux system based on Posix thread library is presented. The application shows the proposed frame can improve the service performance while expand the program's functions effectively.
出处
《微计算机应用》
2007年第4期368-371,共4页
Microcomputer Applications
基金
国家863计划资助项目(2001AA422270)
作者简介
张志佳,男,(1974-),博士,研究方向为模式识别、软件工程等。
于立国,男,(1978-),工程师,研究方向为软件工程、数据通信等。