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

Pthread-of-linux

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

  • read_write
    这个程序是一个linux-arm 根文件系统读写驱动程序。(This program is a linux-arm root file system read and write driver)
    2013-10-17 20:15:06下载
    积分:1
  • SPKZ
    一个沙盘指示灯控制系统,需要硬件PCI843支持(A sand table light control system, the need for hardware support for PCI843)
    2007-09-05 15:14:23下载
    积分:1
  • hidethings
    文件隐藏, 进程隐藏, 注册表项隐藏, 注册表键值隐藏 (Hidden files, hidden processes, registry entries hidden, hidden registry keys)
    2009-11-10 09:59:26下载
    积分:1
  • USB-2_0
    usb驱动开发《USB 2_0原理与工程开发.rar》(usb-driven development " USB 2_0 principles and engineering development. rar" )
    2011-08-28 15:20:27下载
    积分:1
  • CDROMControl
    vc 程序可以实现关盘时的刻录程序。。。绝对能用!赶紧下载吧(vc program can be closed when the disc burning program. . . Absolutely can! Quickly download it)
    2011-08-18 09:33:43下载
    积分:1
  • ECET
    三轴联动数控上位机控制程序,基于美国PARKER运动控制器,适合数控学者使用(Axis linkage CNC PC control program, based on the United States PARKER motion controller for CNC scholars)
    2012-09-28 21:30:21下载
    积分:1
  • accelerationMouse
    传感器读取程序,传感器读取程序 传感器读取程序(Sensors read the procedures, procedures for sensors to read sensor to read the procedures)
    2008-07-23 10:31:37下载
    积分:1
  • EnumDevice
    使用setupapi枚举硬件设备的代码,很经典的(setupapi )
    2012-02-07 18:09:43下载
    积分:1
  • myspy
    迷你间谍程序,一个文件系统的过来驱动程序,侦听捕获所有的读写操作。(Mini spy program, a file system over the driver listens to catch all read and write operations.)
    2014-07-29 12:04:56下载
    积分:1
  • NtUserCallOneParam
    驱动级防止关机!秒杀普通用户,O(∩_∩)O哈哈~(driver to stop system shutdowm)
    2021-03-31 22:49:08下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载