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

Pthread-of-linux

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

  • VendorDeviceIDsExample
    获得Nvidia显卡生产商信息和Device ID的小程序(was Nvidia card maker Device ID information and the small program)
    2006-07-06 14:24:01下载
    积分:1
  • MFC_DLL_LED
    EVC下利用MFC DLL实现的mini2440 LED驱动程序。(LED driver of mini2440 developing board by MFC DLL in EVC)
    2013-05-31 11:46:07下载
    积分:1
  • program_drive
    本文件提供各种驱动程序和汇编代码,包括温度芯片驱动等等.(This document provides various Driver and compile code, including temperature chip-driven, and so on.)
    2007-03-31 15:37:57下载
    积分:1
  • US0B
    说明:  ieee1394驱动程序,一个比一个牛比阿,还差几个字把(ieee1394 drivers, one from a cow than A, put the words worse)
    2005-10-20 00:24:48下载
    积分:1
  • USB_Blaster_WIN7_x64
    altera usb-blaster win7下驱动,经测试可用(altera usb-blaster win7 to drive, the test can be used)
    2020-06-25 21:20:01下载
    积分:1
  • MAppStart
    MIL Application Start
    2011-05-25 15:16:24下载
    积分:1
  • WIN64_qudong
    win 7 64位 驱动编程教程加源码 大牛制造 值得学习 上传分享(Win 7 64-bit drive programming tutorial plus source of large cattle manufacturing is worth learning to share)
    2016-12-31 16:32:17下载
    积分:1
  • SysDriverLoad
    通过SCManager的一系列方法,实现了加载sys文件驱动的功能,安装到系统服务中。(Through a series of SCManager method to achieve a load sys file-driven functionality, install system services.)
    2014-03-21 15:54:27下载
    积分:1
  • KeyBoardLog
    内核键盘记录工具,完美截取XX宝等密码,好用,使用(Kernel keylogger tool, a perfect treasure such as interception XX password, easy to use, use the)
    2020-07-01 09:00:02下载
    积分: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
  • 696516资源总数
  • 106914会员总数
  • 0今日下载