释义 |
mutex 英m'juːteks美m'juːteks BNC²³⁶²¹³⁺¹iWeb³⁴⁰⁶² 基本例句 n.计算机互斥体 The operating system scheduler determines which thread gets control of the mutex next— typically, the reader thread that has waited the longest gets to read the data first. 操作系统调度程序决定哪个线程获得对互斥锁的控制权—通常,等待时间最长的读线程先读取数据。 ibm The mutex is simple, but there are some rules you should remember. 互斥锁很简单,但是有一些规则必须牢记。 ibm The mutex kind can be set in two ways. 可以以两种方式设置互斥的类型。 ibm The mutex object must be declared; once declared, it must be initialized. 互斥量对象必须先被声明;声明后还必须初始化。 ibm Also note that both condition variables use the same mutex. 还要注意,两个条件变量使用相同的互斥锁。 ibm Because you're sharing the same mutex for push and pop operations, the data- read speed is somewhat compromised as writer threads access the lock. 因为添加和取出数据操作使用相同的互斥锁,所以读取数据的速度会影响写数据的线程访问锁。 ibm But you can also create a mutex dynamically. 但是还可以动态地创建互斥对象。 ibm Do we need to lock and unlock the mutex before and after the increment respectively? 那么,是否需要在加一操作语句前后分别锁定和解锁互斥对象呢? ibm However, a mutex should accompany each condition variable. 不过,每个条件变量都应该伴有一个互斥。 ibm However, if the mutex is locked this call won't block. 然而,如果互斥对象已锁定,这个调用也不会阻塞。 ibm If the mutex is currently unlocked you'll get the lock, and this function will return zero. 如果互斥对象当前处于解锁状态,那么您将获得该锁并且函数将返回零。 ibm If not awake otherwise, at the end of the timeout, the reader needs to wake itself up and release the mutex. 如果到超时时间段结束时还没有被唤醒,读线程需要唤醒自身并释放互斥锁。 ibm If possible, just design your program never to re- lock a mutex it already has. 如果可能,在设计程序时决不要锁定一个已经锁定的互斥量。 ibm If the timeout has occurred before the reader thread could acquire the mutex, then no processing need be done. 如果在读线程能够获得互斥锁之前发生了超时,那么不需要进行处理。 ibm If the mutex already happens to be locked, the caller will go to sleep. 如果碰巧已经锁定了互斥对象,调用者将进入睡眠状态。 ibm If you can do this, your threaded code will be really efficient and it won't tie up valuable mutex locks. 如果能够做到这一点,线程代码将是非常高效的,并且不会占用宝贵的互斥对象锁。 ibm It could repeatedly lock and unlock a mutex, each time checking a shared data structure for a certain value. 它可以重复对互斥对象锁定和解锁,每次都会检查共享数据结构,以查找某个值。 ibm Mutexes have names, and only one mutex of a given name can exist on a machine at a time. 互斥有名称,并且,一个给定名称的互斥在同一机器上同一时刻只能存在一个。 ibm Mutexes will insert a“ memory barrier,” which ensures that the writes to main memory occur in the order the threads lock the mutex. 互斥对象将插入一道“内存关卡”,由它来确保对主存的写入按照线程锁定互斥对象的顺序进行。 ibm POSIX provides the mutex function to create critical sections that enforce exclusive access to an object a piece of memory by a single thread. POSIX提供了互斥函数来创建临界区,用于实施单线程对对象一块内存的独占访问。 ibm The first thread locks the mutex and appends data to the queue, while the other threads wait for their turn. 第一个线程锁住互斥并把数据添加到队列中,而其他线程等待轮到它们操作。 ibm The calls act as a warning to other threads to go to sleep and wait their turn for the mutex lock. 这两个函数调用的作用就是警告其它线程,要它们继续睡眠并等待轮到它们对互斥对象加锁。 ibm The error is not due to the locked mutex. 那个错误不是归咎于被锁定的互斥。 ibm This way, the change to add mutex code only has to happen in one place. 这样做使增加互斥代码时只需要在一个子程序中进行改动。 ibm This creates a new mutex and initializes the structure. 这将创建一个新的互斥锁并初始化其结构。 ibm This function gets a pointer to the mutex it is trying to lock. 这个函数会获得一个指向它正在尝试锁定的互斥的指针。 ibm This function takes the handle to the mutex object and waits until it is signaled or timeout occurs. 这个函数会使用一个互斥对象的句柄,并一直等待,直到它变为有信号状态或超时为止。 ibm This routine is called twice— before and after mutex acquisition— to determine whether further processing is required based on the time elapsed. 在获取互斥锁之前和之后各调用这个例程一次,从而根据经过的时间决定是否需要进一步处理。 ibm Mutex me! 互斥我吧! ibm |