CodeBus
www.codebus.net
Search
Sign in
Sign up
Hot Search :
Source
embeded
web
remote control
p2p
game
More...
Location :
Home
Search - Critical Section
Main Category
SourceCode
Documents
Books
WEB Code
Develop Tools
Other resource
Search - Critical Section - List
[
OS Develop
]
mune
DL : 0
线程同步机制。 互斥器的功能和临界区域很相似。区别是:Mutex所花费的时间比Critical Section多的多,但是Mutex是核心对象(Event、Semaphore也是),可以跨进程使用,而且等待一个被锁住的Mutex可以设定TIMEOUT,不会像Critical Section那样无法得知临界区域的情况,而一直死等。-Thread synchronization mechanism. Mutex' s function and the critical region is very similar. The difference is: Mutex spent more time than the multi-Critical Section, but the Mutex is the core object (Event, Semaphore is), you can cross-process use, and has been locked waiting for a Mutex can be set to TIMEOUT, not as Critical Section did not know the critical situation in the region, for so long and so die.
Date
: 2025-12-18
Size
: 1.8mb
User
:
陈小
[
OS Develop
]
110104010104
DL : 0
解决的主要问题 (1)MFC界面设计 (2)模拟生产者消费者的互斥操作 (3)各信号量及互斥体的使用 线程 线程是程序独立运行的基本单位,一个程序通过执行多个线程可以提高机器本身资源的利用率,同时也可以完成多任务并行运行的操作,多线程可以实现并行处理,避免了某项任务长时间占用CPU时间。 互斥体 互斥体与临界区很相似,但是使用时相对复杂一些,它不仅可以在同一应用程序的线程间实现同步,还可以在不同的进程间实现同步,从而实现资源的安全共享。 信号量 信号量是一个在一定范围内变化的整形数据,用来表示一种临界资源,线程通过信号量的值来确定自己的状态是执行还是挂起,各线程间也是通过信号量机制来协调运行顺序一起完成任务,信号量的用法和互斥的用法很相似,不同的是它可以同一时刻允许多个线程访问同一个资源。-The main problem to solve (1) MFC interface design (2) Analog producers and consumers of mutual exclusion Use (3) The semaphore and mutex Thread A thread is the basic unit program run independently of a program by executing multiple threads can improve the utilization of resources in the machine itself, but can also run complete operating multi-tasking, multi-threaded parallel processing can be realized, avoiding a task for a long time CPU time. Mutex Mutex and critical section is very similar, but the use of relatively complex, it can only be implemented in the threads of the same application synchronization, it can also achieve synchronization between different processes, enabling secure sharing of resources. signal Semaphore is a change in a certain range of shaping data used to represent a critical resource, a thread to determine their status through the value of the semaphore is d or suspended, it is to coordinate between the various threads run sequentially through sema
Date
: 2025-12-18
Size
: 5.05mb
User
:
曾小丽
CodeBus
is one of the largest source code repositories on the Internet!
Contact us :
1999-2046
CodeBus
All Rights Reserved.