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

Pthread-of-linux

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

  • Boltzmann
    顶盖驱动流的格子Boltzmann模拟代(The top cover-driven to stream of the plaid Boltzmann simulation of on behalf of)
    2013-04-01 16:16:19下载
    积分:1
  • Usbaudiocap-s
    完整的Avstream usb Audio driver.包括speaker 和microphone 的驱动.可以上传64kbps PCM的话筒数据和下传128Kbps PCM的语音数据.并包括Avstream驱动的inf文件.(full avstream usb audio driver. include speaker and microphone driver.)
    2009-05-19 13:13:35下载
    积分:1
  • WindowsDeviceDriverCode
    说明:  windows设备驱动开发,使用最新的WDF模型(windows Driver Development using WDF)
    2010-04-07 10:29:29下载
    积分:1
  • minusb
    USB driver code for windows nt........complete functionality
    2011-08-05 10:50:49下载
    积分:1
  • TEST-TPM1CH0
    MC9S08AW60的定时器1输入捕获驱动程序(MC9S08AW60 Timer 1 input capture driver)
    2014-03-10 14:41:24下载
    积分:1
  • UI
    说明:  1628显示驱动,完整的驱动代码,高质量的(The display driver 1628, all of the complete code, high-quality)
    2014-11-17 09:39:28下载
    积分:1
  • 001
    L298驱动模块实现马达的正转,反转,和停止功能(L298 motor driver module for forward, reverse and stop functions)
    2014-12-12 09:35:45下载
    积分:1
  • MFCSimReaderTest
    配合我发的F320单片机及其驱动程序的上位机测试程序。完成发送APDU指令(I made the F320 with its single-chip PC driver testing procedures. Finished sending APDU command)
    2014-05-14 18:14:48下载
    积分:1
  • sys98
    说明:  98下的PCI驱动源代码!希望对各位有所帮助 只要稍微修改就可以成为2000的驱动了!(98 PCI driver source code! You want to help as long as it can be slightly modified to be driven by 2000!)
    2006-03-03 16:39:25下载
    积分:1
  • LPT_pr
    lpt_port driver scematic
    2014-07-14 21:50:53下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载