检索规则说明:AND代表“并且”;OR代表“或者”;NOT代表“不包含”;(注意必须大写,运算符两边需空一格)
检 索 范 例 :范例一: (K=图书馆学 OR K=情报学) AND A=范并思 范例二:J=计算机应用与软件 AND (U=C++ OR U=Basic) NOT M=Visual
作 者:申时全[1]
出 处:《现代计算机》2016年第21期65-70,共6页Modern Computer
摘 要:针对网络环境下Socket机制以及Linux对Socket应用接口的支持,探讨基于Linux系统C语言多线程技术的网络并发编程问题。设计并实现C/S方式模拟4人掷骰子游戏的胜率统计程序,设计客户端程序和服务器端程序,服务器程序接收客户端游戏数据,决定胜负关系,将结果传回客户端,统计游戏中每个人获胜的次数,从而获得游戏胜率统计。客户端应用程序使用伪随机数生成函数获得每次掷骰子的点数,每个客户端通过相同策略获取"叫点数"。程序中使用Linux信号量实现线程间的同步关系。Aiming at the support of Socket mechanism and Socket to Linux application interface in network environment, discusses the network con-current programming problem of C language based on Linux system. Designs and realizes the simulation mode of C/S and 4 dice game winning statistical procedures, designs the client and server-side program, server program receive the game client data, decides the outcome of the relationship, results are returned to the client, winning each person in the game statistics the number of to obtain game win-ning percentage and statistics. The client application uses the pseudo random number generating function to get the number of each throw dice; each client gets "call points" by the same strategy. Uses Linux Semaphore in the program to achieve the synchronization between threads.
分 类 号:TP311.1[自动化与计算机技术—计算机软件与理论] TP316.81[自动化与计算机技术—计算机科学与技术]
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在链接到云南高校图书馆文献保障联盟下载...
云南高校图书馆联盟文献共享服务平台 版权所有©
您的IP:216.73.216.171