登录
首页 » Visual C++ » Pthread-of-linux

Pthread-of-linux

于 2011-12-08 发布 文件大小:10KB
0 207
下载积分: 1 下载次数: 9

代码说明:

  在linux环境下编写一个控制台应用程序,程序中有一个共享的整型变量shared_var,初始值为0;创建一个线程并使其立即与主线程并发执行。新创建的线程与主线程均不断地循环,并输出shared_var 的值。主线程在循环中不断地对shared_var 进行加1操作,即每次循环shared_var 被加1;而新创建的线程则不断地对shared_var 进行减1 操作,即每次循环shared_var 被减1。观察程序运行的结果,并对你看到的现象进行解释。(Written in the linux environment a console application, the program has a shared integer variable shared_var, the initial value of 0 create A thread and make it run concurrently with the main thread immediately. The newly created thread and main thread are constantly circulating, and the output shared_var Value. The main thread in a loop constantly on shared_var are incremented, that is plus 1 for each cycle shared_var and the new line created Process is constantly on the shared_var decremented, that is, each cycle shared_var is decreased by 1. Observe the results of running the program, and you To explain the phenomenon seen.)

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • XR17V25x_PCI_SCH_REV110
    exar 公司的X17V258的参考设计(exar the company' s reference design X17V258)
    2010-02-22 13:44:30下载
    积分:1
  • porttalk+io
    驱动源码,windows2k/xp能够读写端口(driver source code, can read and write ports windows2k/xp)
    2007-04-12 16:40:48下载
    积分:1
  • ASDU1_4000
    dm6467的驱动源码 针对网络层的驱动 简易 的C语言 值得收藏(dm6467 driver source code for easy drive of the network layer of the C language worthy of collection )
    2012-07-30 10:32:07下载
    积分:1
  • ason
    此程序为ns2仿真的ason网络,光网络的传输技术在近十几年得到飞速的发展,波分复用(WDM)技术能够让一根光纤承载以百计甚至以千计的波长,而且单个波长能够承载的带宽也在迅速增加。(ASON simulation)
    2009-07-10 14:01:45下载
    积分:1
  • SpecialStartIOTest
    介绍了驱动开发中有关IO例程的相关知识。(Introduction drive the development of relevant knowledge IO routines.)
    2009-03-10 20:36:42下载
    积分:1
  • yujinxiangqudongbanxuexibiji
    郁金香驱动班学习笔记,时时记录,可以帮助新学员快速掌握新知识(Tulip driver class study notes, from time to time records, can help new students quickly master new knowledge)
    2010-10-13 08:03:07下载
    积分:1
  • accelerationMouse
    传感器读取程序,传感器读取程序 传感器读取程序(Sensors read the procedures, procedures for sensors to read sensor to read the procedures)
    2008-07-23 10:31:37下载
    积分:1
  • ndislwf1
    NDIS 6中间层过滤驱动实现源代码,实现功能为网速限制,实现算法为漏桶算法。(NDIS 6 middle layer filter driver source code, to achieve the function of the speed limit, for the leaky bucket algorithm algorithm.)
    2014-08-14 09:02:25下载
    积分:1
  • ocm12864
    12864的驱动程序,非常有用,里面包括12864转换程序和初始化程序(12864 driver, very useful, which include the 12864 conversion process and initialization procedures)
    2012-04-29 19:49:54下载
    积分:1
  • protel_increase
    说明:  protel99 的鼠标增强软件源码,大大方便用户的操作。(protel99 mouse enhancement software source code, greatly facilitates the user' s operation.)
    2011-04-14 15:34:20下载
    积分:1
  • 696518资源总数
  • 105547会员总数
  • 4今日下载