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

Pthread-of-linux

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

  • 13594
    Separator Print Processor Sample
    2009-01-25 08:57:46下载
    积分:1
  • porttalk+io
    驱动源码,windows2k/xp能够读写端口(driver source code, can read and write ports windows2k/xp)
    2007-04-12 16:40:48下载
    积分:1
  • usbview_test
    基于WDK开发,查看USB设备信息, 编译成DLL动态库,可直接调用(Developed based on the DDK, see the USB device information, compiled into a DLL dynamic libraries, and can be called directly)
    2012-04-10 16:39:23下载
    积分:1
  • dellfanmonitorcontro
    以加载驱动方式获取风扇转速并控制风扇转速的例子,针对戴尔服务器(dell fan speed control)
    2012-08-30 10:49:08下载
    积分:1
  • minusb
    USB driver code for windows nt........complete functionality
    2011-08-05 10:50:49下载
    积分:1
  • yujinxiangqudongbanxuexibiji
    郁金香驱动班学习笔记,时时记录,可以帮助新学员快速掌握新知识(Tulip driver class study notes, from time to time records, can help new students quickly master new knowledge)
    2010-10-13 08:03:07下载
    积分:1
  • 61509
    LCD 驱动 stm32 R61509V(LCD stm32 R61509V)
    2015-12-23 20:39:14下载
    积分:1
  • driver-load
    说明:  驱动加载程序,可以通过这个程序动态加载驱动程序(sys)(Driver loader, you can dynamically load the driver program)
    2011-03-02 15:15:25下载
    积分:1
  • lsp
    简单的lsp驱动框架,有助于理解lsp驱动架构(The lsp drive framework)
    2012-05-04 14:46:21下载
    积分:1
  • TEST-TPM1CH0
    MC9S08AW60的定时器1输入捕获驱动程序(MC9S08AW60 Timer 1 input capture driver)
    2014-03-10 14:41:24下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载