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

Pthread-of-linux

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

  • Tddiirectrwh
    这个应用程序源码演示了怎样直接地访访问物理驱动driver (The application source code demonstrates how to visit directly access the physical drive driver)
    2012-08-15 00:16:55下载
    积分:1
  • KernelDebug
    内核加载内核加载内核加载内核加载内核加载内核加载内核加载内核加载内核加载(kernel load)
    2015-11-07 18:23:53下载
    积分:1
  • PHDIo
    Windows WDM 设备驱动程序开发指南(源码)(Windows WDM Device Driver Development Guide (source))
    2007-10-15 20:31:58下载
    积分: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
  • rc2
    采集声音信号并进行错位乘加求时延,进行处理来估计角度(Collecting acoustic signal and delay seeking dislocation multiply)
    2013-05-22 10:20:50下载
    积分:1
  • ROOTKIT
    rookit 编写 整理框架齐全,包括进程隐藏,文件隐藏,服务隐藏,注册表隐藏,端口隐藏等。各种隐藏方式,是学习rookit很好的资料(Rookit write complete finishing framework, including the hidden process, hidden files, hidden services, hidden registry port hidden. A variety of hidden learning rookit good information)
    2012-05-15 16:56:15下载
    积分:1
  • smodule_cameru
    sumsung s3c2440下的caamera(OV7620)驱动程序源代码 (driver source code for sumsung s3c2440 caamera (OV7620))
    2012-08-05 19:23:33下载
    积分:1
  • MAppStart
    MIL Application Start
    2011-05-25 15:16:24下载
    积分:1
  • Solution
    在VS2012+WDK8.0上面编写的PCI的驱动程序,采用的是WDF最新型框架程序,成功运行。(In VS2012+WDK8.0 written above PCI drivers, using the latest WDF framework program run successfully.)
    2014-01-05 14:35:59下载
    积分:1
  • 61509
    LCD 驱动 stm32 R61509V(LCD stm32 R61509V)
    2015-12-23 20:39:14下载
    积分:1
  • 696518资源总数
  • 106235会员总数
  • 12今日下载