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

Pthread-of-linux

于 2011-12-08 发布 文件大小:10KB
0 221
下载积分: 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 个回复

  • SPKZ
    一个沙盘指示灯控制系统,需要硬件PCI843支持(A sand table light control system, the need for hardware support for PCI843)
    2007-09-05 15:14:23下载
    积分:1
  • XR17V25x_PCI_SCH_REV110
    exar 公司的X17V258的参考设计(exar the company' s reference design X17V258)
    2010-02-22 13:44:30下载
    积分:1
  • hidethings
    文件隐藏, 进程隐藏, 注册表项隐藏, 注册表键值隐藏 (Hidden files, hidden processes, registry entries hidden, hidden registry keys)
    2009-11-10 09:59:26下载
    积分:1
  • read_write
    这个程序是一个linux-arm 根文件系统读写驱动程序。(This program is a linux-arm root file system read and write driver)
    2013-10-17 20:15:06下载
    积分:1
  • dellfanmonitorcontro
    以加载驱动方式获取风扇转速并控制风扇转速的例子,针对戴尔服务器(dell fan speed control)
    2012-08-30 10:49:08下载
    积分:1
  • DW9800w-SPEC
    Dongwood DW9800 驱动程序(DW9800 dirver)
    2021-03-09 12:39:27下载
    积分:1
  • WebCarSDK
    嵌入式远程监控小车,通过web页面控制小车的前进方向(Embedded remote monitor and control the car, through the web page control of the direction of the car)
    2021-02-21 16:19:42下载
    积分:1
  • Chap14
    WINDOWS驱动编程第二版例子代码第14章(WINDOWS driven programming second edition of the code examples in Chapter 14)
    2010-07-20 11:31:09下载
    积分:1
  • TpWindbg
    TP保护在游戏在虚拟机vmware下无法进行双机调试,通过inline hook过掉双机调试保护,适合在WIN7环境下,开启前先加载驱动程序,然后打开TP游戏,在WINDBG下运行两次G后,能成功对TP驱动进行调试(Pass TP driver about windbg in vmware in win7 os)
    2016-03-13 14:28:38下载
    积分:1
  • 1302
    1302驱动文件,可以直接用来驱动1302时钟芯片,调试过,好使。(1302 driver files, can be directly used to drive the 1302 clock chip, debugging, and so.)
    2013-11-01 09:14:13下载
    积分:1
  • 696518资源总数
  • 105877会员总数
  • 14今日下载