全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Race condition, critical section, mutual exclusion, lock?

又称: race condition · critical section · mutual exclusion · lock

Definition 31.6 High School Computer Science · 第 31 章 — Processes and Scheduling

A race condition is a bug whose effect depends on the order in which processes happen to run. A critical section is a part of a program that uses shared data and must not run in two processes at once. Mutual exclusion is the guarantee that at most one process is in a critical section at any time. A lock provides it: a process acquires the lock before the critical section and releases it after; a process that tries to acquire a lock already held waits until it is released.

在原文中阅读 →