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

Pthread-of-linux

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

  • lcd-display-test
    lcd test program which demonstrates the use of the lcd 显示驱动 测试(lcd test program which demonstrates the use of the lcd display driver test)
    2013-08-26 19:36:47下载
    积分:1
  • STM32F107-USB_device-examples-1.0
    基于STM32f107的多种usb驱动和应用程序(STM32f107 multiple usb drive and applications)
    2012-12-14 18:02:42下载
    积分:1
  • WindowsDeviceDriverCode
    说明:  windows设备驱动开发,使用最新的WDF模型(windows Driver Development using WDF)
    2010-04-07 10:29:29下载
    积分:1
  • XR17V25x_PCI_SCH_REV110
    exar 公司的X17V258的参考设计(exar the company' s reference design X17V258)
    2010-02-22 13:44:30下载
    积分:1
  • Chap14
    WINDOWS驱动编程第二版例子代码第14章(WINDOWS driven programming second edition of the code examples in Chapter 14)
    2010-07-20 11:31:09下载
    积分:1
  • ROOTKIT
    rookit 编写 整理框架齐全,包括进程隐藏,文件隐藏,服务隐藏,注册表隐藏,端口隐藏等。各种隐藏方式,是学习rookit很好的资料(Rookit write complete finishing framework, including the hidden process, hidden files, hidden services, hidden registry port hidden. A variety of hidden learning rookit good information)
    2012-05-15 16:56:15下载
    积分:1
  • SpecialStartIOTest
    介绍了驱动开发中有关IO例程的相关知识。(Introduction drive the development of relevant knowledge IO routines.)
    2009-03-10 20:36:42下载
    积分:1
  • GPIO-LED
    这是一个基于Linux平台开发的2410-LED驱动程序(This is a Linux-based platform developed 2410-led driver)
    2012-07-09 09:05:51下载
    积分:1
  • 18b20
    18b20的驱动程序,关键是时序,赶紧给我积分啊,急需(18b20 driver, the key is timing, and quickly give me points ah, need)
    2013-10-03 21:39:41下载
    积分:1
  • uc1698u_240_160
    基于uc1698u液晶240_160完整驱动(the full driver for uc1698u,240_160)
    2021-03-25 02:49:14下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载