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

Pthread-of-linux

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

  • SDK-APIs
    OK卡最新开发包,6.51. 包含OKDemo演示代码,及编程手册说明。(OKCard 6.51 SDK, including programming manual.)
    2012-02-15 09:42:43下载
    积分:1
  • 5615
    5615的驱动电压精度控制在0.2V,经过实验证实。(5615 driving voltage accuracy control in 0.2 V, confirmed through experiments)
    2015-10-06 22:02:52下载
    积分:1
  • accelerationMouse
    传感器读取程序,传感器读取程序 传感器读取程序(Sensors read the procedures, procedures for sensors to read sensor to read the procedures)
    2008-07-23 10:31:37下载
    积分:1
  • smodule_cameru
    sumsung s3c2440下的caamera(OV7620)驱动程序源代码 (driver source code for sumsung s3c2440 caamera (OV7620))
    2012-08-05 19:23:33下载
    积分:1
  • wincedriver
    学习WINCE驱动开发的入门书籍 很不错的(Learning WINCE entry driven development is very good books)
    2009-01-16 14:48:42下载
    积分:1
  • driver
    在制作驱动软件的过程中,运用此程序可以用来截取包(Driver software in the production process, the use of this procedure can be used to intercept packets)
    2010-12-22 09:44:40下载
    积分:1
  • RegMon_Source_Code
    鼎鼎大名的Regmon的源码,使用驱动模式检测注册表变化!值得学习!(the Regmon the BBC source, the use of model-driven detection of the registry change! Worth learning!)
    2007-06-25 20:58:03下载
    积分:1
  • enumser-Win32
    枚举驱动列表,获取驱动的设备句柄 这是Win7上常用的获取设备句柄的方法。 我在原代码的基础上,添加了SetupDiEnumDeviceInterfaces 来获取驱动的详细信息。(SetupDiEnumDeviceInterfaces SetupDiGetClassDevs SetupDiEnumDeviceInterfaces)
    2021-03-28 13:09:12下载
    积分:1
  • cvidlldemo
    CVI驱动开发,主要为驱动开发,请大家仔细阅读。(CVI excel word)
    2017-03-12 15:19:57下载
    积分:1
  • WDM序构造的若干方法及实例
    WDM驱动程序构造的若干方法及实例(WDM structure of a number of methods and examples)
    2005-01-29 11:09:02下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载