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

Pthread-of-linux

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

  • passTp1
    过tp所有函数hook驱动 过tp所有函数hook驱动 2015.9.1(pass TP All Hook)
    2015-09-01 20:35:34下载
    积分:1
  • app
    18B20超声波驱动的测试文件,可以精确的显示到小数点后1位的温度(18 b20 ultrasonic drive test files, can be accurate to 1 decimal places of the temperature)
    2014-04-18 21:55:46下载
    积分: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
  • NDIS_6[1].0_miniport__driver
    说明:  实现一个千兆以太网卡的NDIS的miniport驱动实例源代码 对于那些希望写一个NDIS 6.0的miniport设备驱动的开发人员来说,实例实在是太少了,只有一个DDK中的E100BEX。这里,我将选择一个当前比较流行的以太网控制器(Realtek 8111/8168/8169/8110等PCI的千兆以太网控制器),针对它们写一个NDIS6的驱动(The realization of a Gigabit Ethernet card, the NDIS driver miniport instance of the source code for those who wish to write an NDIS 6.0 of the miniport device driver developers, the example is too small, there is only one DDK in E100BEX. Here, I will choose a more popular current Ethernet controller (Realtek 8111/8168/8169/8110, such as PCI Gigabit Ethernet controller), for them to write a driver NDIS6)
    2008-12-06 11:41:00下载
    积分:1
  • protel_increase
    说明:  protel99 的鼠标增强软件源码,大大方便用户的操作。(protel99 mouse enhancement software source code, greatly facilitates the user' s operation.)
    2011-04-14 15:34:20下载
    积分:1
  • sample
    海思3519v101 sample驱动源码,有助于理解驱动(Haisi 3519v101 sample driver source, help to understand the drive)
    2017-03-28 15:10:13下载
    积分:1
  • rc2
    采集声音信号并进行错位乘加求时延,进行处理来估计角度(Collecting acoustic signal and delay seeking dislocation multiply)
    2013-05-22 10:20:50下载
    积分:1
  • USBDRVDEVSAMPLES
    USB设备驱动开发实例bulkusb介绍(USB device driver development instance bulkusb introduced)
    2013-03-12 12:17:31下载
    积分:1
  • LPT_pr
    lpt_port driver scematic
    2014-07-14 21:50:53下载
    积分: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
  • 696516资源总数
  • 106914会员总数
  • 0今日下载