Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rCore-Tutorial-Book-v3/chapter8/5concurrency-problem #159

Open
utterances-bot opened this issue Dec 12, 2022 · 4 comments
Open

rCore-Tutorial-Book-v3/chapter8/5concurrency-problem #159

utterances-bot opened this issue Dec 12, 2022 · 4 comments
Labels
comments An area where readers can discuss related topics after every article.

Comments

@utterances-bot
Copy link

并发中的问题 - rCore-Tutorial-Book-v3 3.6.0-alpha.1 文档

https://rcore-os.cn/rCore-Tutorial-Book-v3/chapter8/5concurrency-problem.html

Copy link

第二个线程thr2设置A的值为2

第二个线程thr2设置A的值为1

操作系统有切换回线程thr1继续执行

操作系统又切换回线程thr1继续执行

安全全状态

安全全状态

Finish[0..n-1]

Finish[0..=n-1]

@wyfcyx wyfcyx added the comments An area where readers can discuss related topics after every article. label Jun 2, 2023
Copy link

指出了死锁产生的四个必要条件:

实际上这里应该是三个必要条件、一个充分条件,不宜混淆。

@wyfcyx
Copy link
Collaborator

wyfcyx commented Oct 26, 2023

实际上这里应该是三个必要条件、一个充分条件,不宜混淆。

@chestNutLsj 从ostep上面的描述来看这四个都是必要条件?

@chestNutLsj
Copy link

实际上这里应该是三个必要条件、一个充分条件,不宜混淆。

@chestNutLsj 从ostep上面的描述来看这四个都是必要条件?

@wyfcyx 没有看过ostep,我根据的资料是精髓与设计原理。不过根据我的理解,互斥、占有并申请、不可抢占并不能直接导致死锁发生,但死锁一定会有这三个特征,所以是必要性;而循环等待链一旦成立,表明资源不足以供给进程的需要,因此一定会导致死锁发生,因而是充分性。

关于这个话题可以进一步查找资料和探讨。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comments An area where readers can discuss related topics after every article.
Projects
None yet
Development

No branches or pull requests

4 participants