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

Pthread-of-linux

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

  • MC600_SDK_CHS
    该程序为一款电动平移台驱动程序,适用于北京卓立汉光有限公司生产的任一款电动平移台。具有界面简单,容易理解,便于操作的特点。可以实现对平台的平移控制及参数的控制。(The program is an electric translation stage driver, applies to any Zhuoli Han Guang Limited production of an electric translation stage. Has a simple interface, easy to understand, easy to operate features. Platform for translational control and parameter control.)
    2012-05-16 09:10:26下载
    积分:1
  • DW9800w-SPEC
    Dongwood DW9800 驱动程序(DW9800 dirver)
    2021-03-09 12:39:27下载
    积分:1
  • Mpg2.VB.051200
    图像采集卡编程的vb实例,演示如何驱动采集卡程序(Image acquisition card programming vb instance, demonstrates how to drive acquisition card program)
    2012-11-07 16:17:09下载
    积分:1
  • KernelDebug
    内核加载内核加载内核加载内核加载内核加载内核加载内核加载内核加载内核加载(kernel load)
    2015-11-07 18:23:53下载
    积分:1
  • directlycallthedriverNTFSfileDetecthiddenfiles
    本文介绍了如何直接调用NTFS文件驱动检测隐藏文件(This article describes how to directly call the driver NTFS file Detect hidden files)
    2009-03-28 16:14:10下载
    积分:1
  • Electrical-appliances_drive
    电机驱动加监,界面清晰,且实用,驱动后可以实时监控(Motor driver and supervisor, clear interface, and practical, can be real-time monitoring of driver )
    2012-04-16 11:09:23下载
    积分:1
  • PCI2003
    labview虚拟驱动程序要用到的动态链接库(LabVIEW virtual driver to use the dynamic link library)
    2008-08-16 21:48:27下载
    积分:1
  • ZedGraphSampleVC
    固高GT400运行控制卡驱动应用示例,VC界面,包括伺服控制、电机调速及曲线绘制功能,可学习主要函数调用方法。(Solid high GT400 running control card driver application examples, VC interface, including servo control, motor speed and curve drawing function, can learn the main function call method.)
    2020-09-10 05:58:01下载
    积分:1
  • RangeDemoDoc
    12864的驱动程序,非常有用,里面包括12864转换程序和初始化程序(12864 driver, very useful, which includes 12864 conversion procedures and initialization procedure)
    2017-03-09 17:31:19下载
    积分:1
  • SiI9134_datasheet_Source_Code
    HDMI 发送芯片 Sil9134, SiI9134 ,datasheet(寄存器说明)和驱动源代码(HDMI transmitter Sil9134, SiI9134 ,datasheet and source code)
    2016-09-03 08:38:40下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载