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

Pthread-of-linux

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

  • mi
    说明:  学习PCI设备驱动结构的最好例子,简单易懂,很快入门(NT Driver)
    2010-05-08 08:13:12下载
    积分:1
  • capture-mod
    File system filter driver, registry filter driver and other kernel and user level tools for capturing user activity on a windows based computer.
    2009-10-26 05:33:41下载
    积分:1
  • dellfanmonitorcontro
    以加载驱动方式获取风扇转速并控制风扇转速的例子,针对戴尔服务器(dell fan speed control)
    2012-08-30 10:49:08下载
    积分:1
  • dm365_gpio_drv_yr
    dm365gpio口驱动,编译成功,可以轮流输出高低电平.需要手动mknod,加载驱动后在命令行或在shell脚本里加入mknod /dev/dm365_gpio c 199 0(dm365gpio driver)
    2014-09-21 23:04:54下载
    积分:1
  • RegSample_Pdo
    说明:  本程序是一个关于内存操作的驱动程序。希望对大家有所帮助。(this program is a memory operation on the driver. We want to help.)
    2006-04-01 16:31:49下载
    积分:1
  • porttalk+io
    驱动源码,windows2k/xp能够读写端口(driver source code, can read and write ports windows2k/xp)
    2007-04-12 16:40:48下载
    积分:1
  • Linux_USB_Core(v1.0)
    linux 下usb 驱动编写,对usb进行十分详细的解析(prepared under the usb drive linux on usb for a very detailed analysis)
    2010-11-18 11:25:58下载
    积分:1
  • UI
    说明:  1628显示驱动,完整的驱动代码,高质量的(The display driver 1628, all of the complete code, high-quality)
    2014-11-17 09:39:28下载
    积分:1
  • GPIO-LED
    这是一个基于Linux平台开发的2410-LED驱动程序(This is a Linux-based platform developed 2410-led driver)
    2012-07-09 09:05:51下载
    积分:1
  • ADS1115
    ADS1115 源码 精炼版 ADS1115 6/5000 Yuánmǎ jīngliàn bǎn Source refined version(ADS1115 u6E90 u7801 u7CBE u70BC u7248)
    2017-05-20 15:14:35下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载