线程状态和进程状态有什么区别?

What is the difference between thread states and process states?

我了解到,如果一个进程被阻塞,它将被换出到磁盘并等待唤醒事件。但是,如果一个进程可以有多个线程,那么如果一个线程被阻塞了怎么办?例如,其中一个线程等待键盘事件,该线程将被阻塞。那么进程会不会也被阻塞了,或者有没有可能只有线程被阻塞而进程是运行?

What I learned is if a process got blocked, it will be swapped out to the disk and wait for wake-up event.

您可能正在阅读一些非常古老的文档。 "process" 可能意味着内核安排的事情。

But, if a process can have multiple threads, what if a thread is blocked? For example, one of the threads waits for a keyboard event, the thread will be blocked. Then will the process also be blocked, or is it possible that only the thread is blocked and process is running?

如果将"process"定义为一个容器,由地址space、文件描述符集等组成,并且可以包含多个线程,那么就没有这样的东西一个进程被阻塞。究竟什么会阻止进程?