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

Pthread-of-linux

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

  • ASDU1_4000
    dm6467的驱动源码 针对网络层的驱动 简易 的C语言 值得收藏(dm6467 driver source code for easy drive of the network layer of the C language worthy of collection )
    2012-07-30 10:32:07下载
    积分:1
  • 20090311_e87c3416f74360b5c654JUkvxUbgTuPd
    可以实现文隐藏的源代码,利用驱动实现彻底隐藏文件(file hilde)
    2010-05-08 08:19:10下载
    积分:1
  • PHDIo
    Windows WDM 设备驱动程序开发指南(源码)(Windows WDM Device Driver Development Guide (source))
    2007-10-15 20:31:58下载
    积分:1
  • FG12864
    LCD驱动软件,st7565r液晶显示,串行模式(LCD driver software, st7565r liquid crystal display, serial mode)
    2007-11-05 23:21:30下载
    积分:1
  • ShellExe
    程序直接用键盘过滤驱动拦截键盘数据,可以屏蔽掉系统热键以实现自己想要的功能。通过设置快捷键命令,可以通过任意键的组合实现快速打开运用程序和网址两个功能。 (Procedures for the direct use of the keyboard filter driver to intercept the keyboard data, you can mask out the system hot key to achieve their desired functionality. By setting the shortcut command keys can be any combination of rapid application programs and web site to open two functions.)
    2009-11-20 13:49:10下载
    积分:1
  • 2
    说明:  this is my first program that whil share with you
    2009-11-17 15:03:03下载
    积分:1
  • huawei_HandsetWinDriver
    手机的驱动,话为手机 官方更新,电信 定只的集资(Phone driver, if the official update for the phone, telecommunications fixed capital formation only)
    2013-10-12 19:43:21下载
    积分:1
  • TEST-TPM1CH0
    MC9S08AW60的定时器1输入捕获驱动程序(MC9S08AW60 Timer 1 input capture driver)
    2014-03-10 14:41:24下载
    积分:1
  • Solution
    在VS2012+WDK8.0上面编写的PCI的驱动程序,采用的是WDF最新型框架程序,成功运行。(In VS2012+WDK8.0 written above PCI drivers, using the latest WDF framework program run successfully.)
    2014-01-05 14:35:59下载
    积分: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
  • 696516资源总数
  • 106914会员总数
  • 0今日下载