V2EX  ›  英汉词典

Mutex

定义 Definition

mutex(互斥锁)是并发编程中用于保证同一时间只有一个线程/进程进入某段关键代码(临界区)的同步机制,用来避免共享资源被同时修改而产生错误。(常见还有其他用法与实现细节,但核心含义是“互斥访问”。)

发音 Pronunciation (IPA)

/ˈmjuːtɛks/

例句 Examples

I used a mutex to protect the counter.
我用互斥锁来保护这个计数器。

To avoid race conditions, the program acquires a mutex before updating the shared configuration and releases it immediately afterward.
为避免竞争条件,程序在更新共享配置前先获取互斥锁,并在更新完成后立刻释放。

词源 Etymology

mutexmutual exclusion(互斥) 的缩写形式:mutual(相互的)+ exclusion(排除),字面意思就是“相互排除同时进入”,引申为“同一时刻只允许一个执行者进入关键区域”。

相关词 Related Words

文献与作品 Literary Works

  • Operating System Concepts(Silberschatz, Galvin, Gagne)——在进程/线程同步章节中讨论互斥与锁
  • The Art of Multiprocessor Programming(Herlihy, Shavit)——以互斥与并发控制为核心主题
  • Programming with POSIX Threads(David R. Butenhof)——详细介绍 pthread mutex 的使用与陷阱
  • The C++ Programming Language(Bjarne Stroustrup)/ C++ 并发相关章节与示例中常出现 mutex(尤其在介绍标准库并发工具时)
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   925 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 23:39 · PVG 07:39 · LAX 15:39 · JFK 18:39
♥ Do have faith in what you're doing.