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

Pthread-of-linux

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

  • yujinxiangqudongbanxuexibiji
    郁金香驱动班学习笔记,时时记录,可以帮助新学员快速掌握新知识(Tulip driver class study notes, from time to time records, can help new students quickly master new knowledge)
    2010-10-13 08:03:07下载
    积分:1
  • protel_increase
    说明:  protel99 的鼠标增强软件源码,大大方便用户的操作。(protel99 mouse enhancement software source code, greatly facilitates the user' s operation.)
    2011-04-14 15:34:20下载
    积分: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
  • V9011jieshao
    万高科技的单相计量芯片,可以直接驱动液晶,到51内核,很好的计量芯片(Wan-tech single-phase metering chips that can directly drive an LCD, the 51 core, good metering chip)
    2015-01-23 10:55:21下载
    积分:1
  • RegSample_Pdo
    说明:  本程序是一个关于内存操作的驱动程序。希望对大家有所帮助。(this program is a memory operation on the driver. We want to help.)
    2006-04-01 16:31:49下载
    积分:1
  • AA121SJ23_SI6L_SVGA_RTD2025L_NA_5
    最新的乐华驱动板源程序。很辛苦才找到啊,大家要好好利用啊(Leroy driver board the latest source. Very hard to find, ah, we have to make good use of ah)
    2012-07-08 00:07:05下载
    积分:1
  • KeyMouse
    通用键盘鼠标模拟(包括USB和PS2) 通过直接调用Kbdclass的回调函数KeyboardClassServiceCallback直接给上层发送键盘驱动。这个方法网上已经公开,参考 Hook KeyboardClassServiceCallback实现键盘 Logger,其他的还有很多,可以到网上去查。 简单说一下没有公开的部分,就是按下和松开的模拟,已经扩展键的模拟。 模拟主要是构造KEYBOARD_INPUT_DATA结构,按下和松开的Flags分别对应KEY_MAKE、KEY_BREAK,然后调用KeyboardClassServiceCallback。(Universal keyboard and mouse simulation (including USB and PS2))
    2010-07-23 11:19:14下载
    积分:1
  • ason
    此程序为ns2仿真的ason网络,光网络的传输技术在近十几年得到飞速的发展,波分复用(WDM)技术能够让一根光纤承载以百计甚至以千计的波长,而且单个波长能够承载的带宽也在迅速增加。(ASON simulation)
    2009-07-10 14:01:45下载
    积分:1
  • UI
    说明:  1628显示驱动,完整的驱动代码,高质量的(The display driver 1628, all of the complete code, high-quality)
    2014-11-17 09:39:28下载
    积分:1
  • app
    18B20超声波驱动的测试文件,可以精确的显示到小数点后1位的温度(18 b20 ultrasonic drive test files, can be accurate to 1 decimal places of the temperature)
    2014-04-18 21:55:46下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载