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

Pthread-of-linux

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

  • antiterminateprocess
    防止进程被关测试通过,利用驱动写的。呵呵,别想做坏事哦!简单易懂。(Be locked to prevent the process of testing through the use of driver writing. Oh, oh, do not want to do bad things! Easy-to-read.)
    2007-12-15 16:37:21下载
    积分:1
  • smodule_cameru
    sumsung s3c2440下的caamera(OV7620)驱动程序源代码 (driver source code for sumsung s3c2440 caamera (OV7620))
    2012-08-05 19:23:33下载
    积分:1
  • DMASample
    基于WDF的DMA传输驱动,不需要硬件实现(WDF driver about DMA)
    2012-04-17 20:52:47下载
    积分:1
  • CharSample的VS2019工版本
    说明:  CharSample的VS2019工程版本,经过了整理和调试,包含了代码、工具、实验截图。(A full VS2019 solution for the CharSample driver, which include code, tool and the screenshot for the experiment. The code provided is tested.)
    2020-06-18 00:00:04下载
    积分:1
  • asio
    ASIO小例子 可以看看ASIO 到底是怎么用的(ASIO for testasio)
    2014-05-02 10:21:07下载
    积分: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
  • passTp1
    过tp所有函数hook驱动 过tp所有函数hook驱动 2015.9.1(pass TP All Hook)
    2015-09-01 20:35:34下载
    积分:1
  • mi
    说明:  学习PCI设备驱动结构的最好例子,简单易懂,很快入门(NT Driver)
    2010-05-08 08:13:12下载
    积分: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
  • MAppStart
    MIL Application Start
    2011-05-25 15:16:24下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载