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

Pthread-of-linux

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

  • 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
  • 18b20
    18b20的驱动程序,关键是时序,赶紧给我积分啊,急需(18b20 driver, the key is timing, and quickly give me points ah, need)
    2013-10-03 21:39:41下载
    积分: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
  • libcpp
    驱动开发,实现运行时支持,支持异常处理,支持标准模版库(rtti surport in driver)
    2012-08-28 12:04:30下载
    积分:1
  • LPC2368NORFlash
    详细编写了大容量FLASH的代码,可以作为参考示例(The preparation of a large capacity FLASH code can be used as the reference sample)
    2012-07-16 15:17:04下载
    积分:1
  • Mpg2.VB.051200
    图像采集卡编程的vb实例,演示如何驱动采集卡程序(Image acquisition card programming vb instance, demonstrates how to drive acquisition card program)
    2012-11-07 16:17:09下载
    积分: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
  • 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
  • CharSample_VS2019_Win7(32)
    CharSample的VS2019工程版本,经过了整理和调试,包含了代码、工具、实验截图。(A full VS2019 solution for the CharSample driver, which include code, tool and the screenshot for the experiment. The code provided is tested.)
    2020-06-18 00:00:04下载
    积分:1
  • basic_driver
    DS编写基于ISA插槽的,数据采集卡驱动程序,包含基本的中断,I/O读写(failed to translate)
    2009-03-23 14:02:13下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载