进程同步经典问题_同步的经典问题

进程同步经典问题

In this tutorial we will discuss about various classic problem of synchronization.

在本教程中,我们将讨论各种经典的同步问题。

Semaphore can be used in other synchronization problems besides Mutual Exclusion.

信号量可用于互斥之外的其他同步问题中。

Below are some of the classical problem depicting flaws of process synchronaization in systems where cooperating processes are present.

以下是一些经典问题,它们描述了存在协作流程的系统中流程同步的缺陷。

We will discuss the following three problems:

我们将讨论以下三个问题:

  1. Bounded Buffer (Producer-Consumer) Problem

    有界缓冲区(生产者-消费者)问题

  2. Dining Philosophers Problem

    餐饮哲学家的问题

  3. The Readers Writers Problem

    读者作家问题

有界缓冲区问题 (Bounded Buffer Problem)

  • This problem is generalised in terms of the Producer Consumer problem, where a finite buffer pool is used to exchange messages between producer and consumer processes.

    这个问题是根据生产者消费者问题来概括的,在该问题中有限的缓冲池用于在生产者和消费者进程之间交换消息。

  • Because the buffer pool has a maximum size, this problem is often called the Bounded buffer problem.

    因为缓冲池具有最大大小,所以此问题通常称为有界缓冲区问题

  • Solution to this problem is, creating two counting semaphores "full" and "empty" to keep track of the current number of full and empty buffers respectively.

    解决此问题的方法是,创建两个计数信号量“ full”和“ empty”以分别跟踪当前的缓冲区数量。

餐饮哲学家的问题 (Dining Philosophers Problem)

  • The dining philosopher's problem involves the allocation of limited resources to a group of processes in a deadlock-free and starvation-free manner.

    饮食哲学家的问题涉及以无死锁和无饥饿的方式将有限的资源分配给一组进程。

  • There are five philosophers sitting around a table, in which there are five chopsticks/forks kept beside them and a bowl of rice in the centre, When a philosopher wants to eat, he uses two chopsticks - one from their left and one from their right. When a philosopher wants to think, he keeps down both chopsticks at their original place.

    桌子周围有五位哲学家,旁边放着五把筷子/叉子,中间有一碗饭。当一位哲学家想吃饭时,他用两把筷子-一只在左边,另一只在右边。 。 当一个哲学家想思考的时候,他把两把筷子都放在原来的地方。

读者作家问题 (The Readers Writers Problem)

  • In this problem there are some processes(called readers) that only read the shared data, and never change it, and there are other processes(called writers) who may change the data in addition to reading, or instead of reading it.

    在这个问题中,有一些进程(称为readers )仅读取共享数据,而从不更改它,还有其他进程(称为writers )除了读取或代替读取数据之外,还可能更改数据。

  • There are various type of readers-writers problem, most centred on relative priorities of readers and writers.

    存在各种类型的读者-作家问题,其中大多数集中在读者和作家的相对优先级上。

翻译自: https://www.studytonight.com/operating-system/classical-synchronization-problems

进程同步经典问题

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值