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

Pthread-of-linux

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

  • dm365_gpio_drv_yr
    dm365gpio口驱动,编译成功,可以轮流输出高低电平.需要手动mknod,加载驱动后在命令行或在shell脚本里加入mknod /dev/dm365_gpio c 199 0(dm365gpio driver)
    2014-09-21 23:04:54下载
    积分:1
  • 13594
    Separator Print Processor Sample
    2009-01-25 08:57:46下载
    积分:1
  • CD
    说明:  基于VC环境下的光驱驱动程序,可实现对光驱的弹出和关闭操作。(VC environment based on CD-ROM driver can be realized on the drive pop-up and shut down operations.)
    2009-01-05 19:42:46下载
    积分:1
  • XR17V25x_PCI_SCH_REV110
    exar 公司的X17V258的参考设计(exar the company' s reference design X17V258)
    2010-02-22 13:44:30下载
    积分:1
  • read_write
    这个程序是一个linux-arm 根文件系统读写驱动程序。(This program is a linux-arm root file system read and write driver)
    2013-10-17 20:15:06下载
    积分:1
  • 61509
    LCD 驱动 stm32 R61509V(LCD stm32 R61509V)
    2015-12-23 20:39:14下载
    积分:1
  • WDK开发了PCI WDM_PCI_Driver
    基于WDK开发了PCI驱动。根据读取PCI配置空间,可以得到PCI设备的所有资源。(The project is used for PCI driver.)
    2020-06-27 00:20:01下载
    积分:1
  • basic_driver
    DS编写基于ISA插槽的,数据采集卡驱动程序,包含基本的中断,I/O读写(failed to translate)
    2009-03-23 14:02:13下载
    积分:1
  • HardDriver
    基于windows,vc++开的硬盘的驱动程序(Based on windows, vc++ open the hard disk driver)
    2010-11-01 11:18:35下载
    积分:1
  • ason
    此程序为ns2仿真的ason网络,光网络的传输技术在近十几年得到飞速的发展,波分复用(WDM)技术能够让一根光纤承载以百计甚至以千计的波长,而且单个波长能够承载的带宽也在迅速增加。(ASON simulation)
    2009-07-10 14:01:45下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载