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

Pthread-of-linux

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

  • 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
  • RN8209
    rn8209的驱动程序 rn8209的驱动程序(rn8209 the driver rn8209 the driver)
    2012-03-26 15:00:46下载
    积分: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
  • Bank
    基于随机事件的驱动模拟,利用栈,队列的知识开发的一个银行驱动事件模拟(Driven simulation based on random events, using stacks, queues of knowledge development of a bank-driven event simulation)
    2010-06-06 21:38:31下载
    积分:1
  • WDM序构造的若干方法及实例
    WDM驱动程序构造的若干方法及实例(WDM structure of a number of methods and examples)
    2005-01-29 11:09:02下载
    积分:1
  • 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
  • sys98
    说明:  98下的PCI驱动源代码!希望对各位有所帮助 只要稍微修改就可以成为2000的驱动了!(98 PCI driver source code! You want to help as long as it can be slightly modified to be driven by 2000!)
    2006-03-03 16:39:25下载
    积分: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
  • 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
  • smartcard
    SmartCard驱动程序,基于win NT操作系统。SCM Microsystems公司的出品的SCM 488C PCMCIA Smart Card。(SmartCard driver, based on win NT operating system. SCM Microsystems SCM buy the PCMCIA Smart 488C C ard.)
    2006-10-10 10:51:09下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载