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

Pthread-of-linux

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

  • [VB]_GetPCInfo
    讀取 PCI Bus 相關資訊 , 方便研究與了解(Call Back the PCI Bus Information to learning and Study)
    2016-08-05 17:03:10下载
    积分:1
  • CSCommTest
    说明:  串口驱动程序,在界面上能发送接收数据,主要是参照网上的教程实现的,代码能运行通过,是一个界面程序(Serial port driver, the interface can send receive data, mainly by reference to the realization of online tutorials, and code to run through, is an interface program)
    2008-12-08 09:41:19下载
    积分:1
  • PassTP
    过大部分Tx公司的tp驱动保护,跟别人3000元在淘宝购买的(Pass the Ten*cent tp driver proctest, the prise is $3000 dollar)
    2013-05-07 22:35:11下载
    积分:1
  • DriverWizard
    用C++实现的网络驱动程序向导代码。可以简单的创建一个工作区,并从工程中选择一个类型作为客户应用(Implemented using C++ code for the network driver wizard. You can simply create a work zone and choose a type from the project as a client application)
    2009-12-14 23:36:35下载
    积分: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
  • Solution
    在VS2012+WDK8.0上面编写的PCI的驱动程序,采用的是WDF最新型框架程序,成功运行。(In VS2012+WDK8.0 written above PCI drivers, using the latest WDF framework program run successfully.)
    2014-01-05 14:35:59下载
    积分:1
  • KeyMouse
    通用键盘鼠标模拟(包括USB和PS2) 通过直接调用Kbdclass的回调函数KeyboardClassServiceCallback直接给上层发送键盘驱动。这个方法网上已经公开,参考 Hook KeyboardClassServiceCallback实现键盘 Logger,其他的还有很多,可以到网上去查。 简单说一下没有公开的部分,就是按下和松开的模拟,已经扩展键的模拟。 模拟主要是构造KEYBOARD_INPUT_DATA结构,按下和松开的Flags分别对应KEY_MAKE、KEY_BREAK,然后调用KeyboardClassServiceCallback。(Universal keyboard and mouse simulation (including USB and PS2))
    2010-07-23 11:19:14下载
    积分: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
  • WDK开发了PCI WDM_PCI_Driver
    基于WDK开发了PCI驱动。根据读取PCI配置空间,可以得到PCI设备的所有资源。(The project is used for PCI driver.)
    2020-06-27 00:20:01下载
    积分:1
  • PCI-9524-Users-Guide
    PCI 数据采集卡,9524,实现数据采集,凌华的卡,性能高,性价比好(PCI Card,easy to use,very good,cheap and can fit many cases)
    2016-06-02 14:41:48下载
    积分:1
  • 696516资源总数
  • 106425会员总数
  • 12今日下载