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

Pthread-of-linux

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

  • driverDDKFloowMe02
    黑客防线:windows 驱动开发视频培训教程 02(Hacker Defense: windows-Driven Development Video Training Tutorial 02)
    2010-01-21 10:04:50下载
    积分:1
  • ntstatus
    查看NT状态 (Viewing NT state)
    2020-07-01 12:40:02下载
    积分:1
  • lsp
    简单的lsp驱动框架,有助于理解lsp驱动架构(The lsp drive framework)
    2012-05-04 14:46:21下载
    积分:1
  • Focaltech-Driver
    FT的驱动代码,费了好大的劲才获得的,请参考并提出宝贵意见。(FT s driving code,it s very difficult to get it, please refer to it and give you good opinion.)
    2014-04-08 12:22:34下载
    积分:1
  • SD-based-on-STM32
    SD程序基于STM32,底层的驱动程序已被写入,并有notes.it值得初级开发者学习。(SD program based on STM32, the underlying driver has been written, and there is a notes.it worthy of the primary developers to learn.)
    2017-02-23 16:25:28下载
    积分:1
  • rc2
    采集声音信号并进行错位乘加求时延,进行处理来估计角度(Collecting acoustic signal and delay seeking dislocation multiply)
    2013-05-22 10:20:50下载
    积分:1
  • 001
    L298驱动模块实现马达的正转,反转,和停止功能(L298 motor driver module for forward, reverse and stop functions)
    2014-12-12 09:35:45下载
    积分:1
  • 1302
    1302驱动文件,可以直接用来驱动1302时钟芯片,调试过,好使。(1302 driver files, can be directly used to drive the 1302 clock chip, debugging, and so.)
    2013-11-01 09:14:13下载
    积分:1
  • myWDK
    这是一个C++驱动级内存读写源码,可以实现读写一些受保护游戏的内存。。(This is a C++ source code to read and write memory drive level, you can read and write some of the protected memory game.)
    2014-12-06 09:43:51下载
    积分:1
  • moni
    驱动级鼠标模拟 包含鼠标。键盘。驱动及模拟,附有小程序(Driver stage mouse emulation)
    2020-10-13 23:17:31下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载