What is a mutex"Mutex" is the abbreviated form of the term "mutually exclusive (mutually exclusive)", which is the mutex amount. The mutex is similar to the monitor mentioned in the critical section, where only the line friend with the mutex has
Mutex is a key. When a person takes the key, they can enter a room. When they come out, the key is handed over to the first in the queue. Generally, this method is used to serialize the access to the critical section code to ensure that the Code is
Mutex is a simple form of synchronization (called mutex )). The mutex prohibits multiple threads from entering the protected code "critical section" at the same time ). Therefore, at any time, only one thread is allowed to enter such a code
Multi-threaded threads synchronize mutex (the function is the same as that of the criticalsection, which ensures that only one thread can access Shared resources at a certain time point, but is a kernel object. Therefore, the access speed is slower
Overview:
Non-kernel object critical zones are very suitable for serializing access to data in a process because they are fast. However, we may want to synchronize some applications with other special events on the computer or operations executed in
Critical Section)
A convenient way to ensure that only one thread can access data at a certain time point. Only one thread is allowed to access Shared resources at any time. If multiple threads attempt to access the critical section at the same
A mutex is a synchronization primitive that can be synchronized between processes.
name
description
Mutex()
Mutex class with default properties.">Initializes a new instance of the Mutex class using
C # multithreaded Learning (vi) How the mutex controls the connection of multiple threads to each other, does not create conflicts and duplicates, requires the use of mutex objects, namely: The Mutex class in the System.Threading namespace. We can
Mutex (mutex)A mutex is a mutually exclusive synchronization object that means that only one thread can get it at the same time.Mutexes can be used when a shared resource can be accessed by only one thread at a timeFunction:Create a mutex that is in
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.