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

Pthread-of-linux

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

  • smartcard
    SmartCard驱动程序,基于win NT操作系统。SCM Microsystems公司的出品的SCM 488C PCMCIA Smart Card。(SmartCard driver, based on win NT operating system. SCM Microsystems SCM buy the PCMCIA Smart 488C C ard.)
    2006-10-10 10:51:09下载
    积分:1
  • ocm12864
    12864的驱动程序,非常有用,里面包括12864转换程序和初始化程序(12864 driver, very useful, which include the 12864 conversion process and initialization procedures)
    2012-04-29 19:49:54下载
    积分:1
  • load_Sys
    说明:  驱动程序加载卸载工具 编写RootKit加载驱动程序的测试工具 自己写的(Driver loading and unloading tools prepared RootKit driver load testing tool wrote it myself)
    2008-10-02 12:55:44下载
    积分:1
  • EtherNetIPExampleCode
    基于EthernetIP协议的应用程序,可以读取AB公司Controllogix系列Ethernetip协议PLC数据. 此软件代码可用于工业控制.(EthernetIP agreement based on the application, the company can read AB ControlLogix PLC data series Ethernetip agreement. This software code can be used for industrial control.)
    2020-11-21 22:19:36下载
    积分:1
  • SD-based-on-STM32
    SD程序基于STM32,底层的驱动程序已被写入,并有notes.it值得初级开发者学习。(SD program based on STM32, the underlying driver has been written, and there is a notes.it worthy of the primary developers to learn.)
    2017-02-23 16:25:28下载
    积分:1
  • libcpp
    驱动开发,实现运行时支持,支持异常处理,支持标准模版库(rtti surport in driver)
    2012-08-28 12:04:30下载
    积分: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
  • NtUserCallOneParam
    驱动级防止关机!秒杀普通用户,O(∩_∩)O哈哈~(driver to stop system shutdowm)
    2021-03-31 22:49:08下载
    积分:1
  • trajectory_vers2
    轨迹跟踪程序例子(example)
    2004-09-27 16:49:19下载
    积分:1
  • SPKZ
    一个沙盘指示灯控制系统,需要硬件PCI843支持(A sand table light control system, the need for hardware support for PCI843)
    2007-09-05 15:14:23下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载