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

Pthread-of-linux

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

  • loadsys
    一个简单的xp和2k3系统下加载驱动和卸载驱动的源码(Under a simple xp and 2k3 system load and unload the driver source drive)
    2014-01-22 14:45:43下载
    积分:1
  • KeyBoardLog
    内核键盘记录工具,完美截取XX宝等密码,好用,使用(Kernel keylogger tool, a perfect treasure such as interception XX password, easy to use, use the)
    2020-07-01 09:00:02下载
    积分:1
  • CSCommTest
    说明:  串口驱动程序,在界面上能发送接收数据,主要是参照网上的教程实现的,代码能运行通过,是一个界面程序(Serial port driver, the interface can send receive data, mainly by reference to the realization of online tutorials, and code to run through, is an interface program)
    2008-12-08 09:41:19下载
    积分:1
  • directlycallthedriverNTFSfileDetecthiddenfiles
    本文介绍了如何直接调用NTFS文件驱动检测隐藏文件(This article describes how to directly call the driver NTFS file Detect hidden files)
    2009-03-28 16:14:10下载
    积分:1
  • comcap
    非常实用的内核开发资 料。在实际工作中可能经经用到。(Very useful kernel development information. In practical work may been used.)
    2013-04-19 23:35:32下载
    积分:1
  • driver_manage
    管理驱动,包括安装、删除、停止等,使用MFC写的UI,方便管理驱动(manage driver, includes install, remove, start, stop. use mfc to manage driver confidently)
    2013-03-07 21:50:47下载
    积分:1
  • lsp
    简单的lsp驱动框架,有助于理解lsp驱动架构(The lsp drive framework)
    2012-05-04 14:46:21下载
    积分:1
  • Submonitor
    Using mirror driver as filter driver in capture desktop screen operation allow system run faster than using device context memory.
    2020-06-26 14:20:01下载
    积分:1
  • PassTP
    过大部分Tx公司的tp驱动保护,跟别人3000元在淘宝购买的(Pass the Ten*cent tp driver proctest, the prise is $3000 dollar)
    2013-05-07 22:35:11下载
    积分:1
  • HardDriver
    基于windows,vc++开的硬盘的驱动程序(Based on windows, vc++ open the hard disk driver)
    2010-11-01 11:18:35下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载