阻止进程意味着什么? [英] What does it mean for a process to block?
问题描述
在我的OS课上,我的教授在描述多线程/同步时一直使用block作为动词,而不是形容词.例如:线程B尝试访问线程A当前正在使用的资源,因此线程B处于阻塞状态."
In my OS class, my professor keeps using block as a verb instead of an adjective when describing multi-threading/synchronization. For example: "Thread B tries to access a resource that is currently being used by Thread A, and so Thread B blocks."
在没有任何先验知识的情况下,我最初会认为,要阻塞某个线程,它将阻止其他某个线程执行某项操作(例如,它持有资源的锁).但是从他的讲话方式来看,听起来线程B块"实际上意味着线程B被正在被阻止或阻止访问其想要访问的资源.
Without any prior knowledge, I would initially think that for a thread to block, it would be preventing some other thread from doing something (e.g. it holds the lock on a resource). But from the way he talks, it sounds like "Thread B blocks" actually means that Thread B is being blocked, or prevented, from accessing the resource it wants to access.
哪个是正确的?
推荐答案
您的插值是正确的:当说线程B阻塞"时,它意味着线程B的操作在某些情况下可能会被挂起(可能会或可能不会实现) ,例如出现死锁时就是不是".
Your interpolation is correction: When it is said "Thread B blocks" it means that thread B's operation is suspended pending some condition (which may or may not be achieved, "not" being the case in a deadlock for instance).
这篇关于阻止进程意味着什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!