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

Pthread-of-linux

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

  • WindowsDeviceDriverCode
    说明:  windows设备驱动开发,使用最新的WDF模型(windows Driver Development using WDF)
    2010-04-07 10:29:29下载
    积分:1
  • ntstatus
    查看NT状态 (Viewing NT state)
    2020-07-01 12:40:02下载
    积分:1
  • uc1698u_240_160
    基于uc1698u液晶240_160完整驱动(the full driver for uc1698u,240_160)
    2021-03-25 02:49:14下载
    积分:1
  • loadsys
    一个简单的xp和2k3系统下加载驱动和卸载驱动的源码(Under a simple xp and 2k3 system load and unload the driver source drive)
    2014-01-22 14:45:43下载
    积分:1
  • mx25l256
    MX251256FLASH芯片驱动程序,内涵片擦除,页擦除,扇擦除,页写等(MX251256FLASH base driver code)
    2016-03-23 11:06:49下载
    积分:1
  • 1302
    1302驱动文件,可以直接用来驱动1302时钟芯片,调试过,好使。(1302 driver files, can be directly used to drive the 1302 clock chip, debugging, and so.)
    2013-11-01 09:14:13下载
    积分:1
  • PHDIo
    Windows WDM 设备驱动程序开发指南(源码)(Windows WDM Device Driver Development Guide (source))
    2007-10-15 20:31:58下载
    积分:1
  • XR17V25x_PCI_SCH_REV110
    exar 公司的X17V258的参考设计(exar the company' s reference design X17V258)
    2010-02-22 13:44:30下载
    积分:1
  • hello
    驱动开发的一个小例子,可以在vs中运行,非常适合新手,共同进步(a simple case of driver ,it is useful for people who first learn driver.hope you like)
    2015-09-16 16:16:50下载
    积分:1
  • 13594
    Separator Print Processor Sample
    2009-01-25 08:57:46下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载