跟读练习: FANG Interview Question | Process vs Thread - 通过视频学习英语口语
选择练习模式
每种模式都会打开全屏练习室。
47 句
如果句子过短或过长,请点击 Edit 进行调整。
1
What's the difference between process and thread?
2
This is a common interview question.
3
Let's take a look.
4
To better answer this question, let's first understand what a program is.
5
A program is an executable file.
6
It contains the code or a set of processing instructions that is stored as a file on disk.
7
When the code in the program is loaded into memory and executed by the processor, it becomes a process.
8
An active process also includes the resources the program needs to run.
9
These resources are managed by the operating system.
10
Some examples are processor registers, program counters, stack pointers, memory pages assigned to the process for its heap and stack,
11
etc. There is an important property of a process that is worth mentioning.
12
Each process has its own memory address space.
13
One process cannot corrupt the memory space of another process.
14
This means that when one process malfunctions, other processes keep running.
15
Chrome is famous for taking advantage of this process isolation by running each tab in its own process.
16
When one tab misbehaves due to a bug or a malicious attack, other tabs are unaffected.
17
Now what is a thread?
18
A thread is the unit of execution within a process.
19
A process has at least one thread.
20
It is called the main thread.
21
It is not uncommon for a process to have many threads.
22
Each thread has its own stack.
23
Earlier we mentioned registers, program counters, and stack pointers as being part of a process.
24
It is more accurate to say that those things belong to a thread.
25
Threads within a process share a memory address space.
26
It is possible to communicate between threads using that shared memory space.
27
However, one misbehaving thread could bring down the entire process.
28
How does the operating system run a thread or process on a CPU?
29
This is handled by context switching.
30
During a context switch, one process is switched out of the CPU so another process can run.
31
The operating system stores the states of the current running process, so the process can be restored and resume execution at a later point.
32
It then restores the previously saved states of a different process and resumes execution for that process.
33
Contact switching is expensive.
34
It involves saving and loading of registers, switching out memory pages, and updating various kernel data structures.
35
Switching execution between threads also requires context switching.
36
It is generally faster to switch context between threads than between processes.
37
There are fewer states to track, and more importantly, since threads share the same memory address space,
38
there is no need to switch out virtual memory pages, which is one of the more expensive operations during a context switch.
39
Contact switching is so costly, there are other mechanisms to try to minimize it, some examples of fibers and coroutines.
40
These mechanisms trace complexity for even lower contact switching cost.
41
In general, they are cooperatively scheduled, that is, they must yield control for others to run.
42
In other words, the application itself handles task scheduling.
43
It is the responsibility of the application to make sure a long -running task is broken up by yielding periodically.
44
This concludes our discussion of process and threads.
45
If you'd like to learn more about system design, check out our books and weekly newsletter.
46
Please subscribe if you learn something new.
47
Thank you so much and we'll see you next time.
同频道
FOR YOU
推荐视频
本课的词汇与口语要点
这节口语课以视频“FANG Interview Question”为素材。 视频中反复出现的词有:process, thread, memory, switching, program。 这段视频共有 47 个句子、565 个单词可供跟读。 讲话部分时长为 3:41。 说话人语速自然,每分钟约 153 个词,接近日常对话。 只有 78% 的单词属于英语最常用的 3,000 词,词汇难度较高。
视频中的重点词汇
视频中 15 个值得学习的单词,附发音和释义:
| 单词 | 发音 | 释义 |
|---|---|---|
| thread 名词 | /ˈθɹɛd/ | 線 /线 |
| execution 名词 | /ˌɛk.sɪˈkjuː.ʃən/ | 執行 /执行, 實行 /实行 |
| stack 名词 | /stæk/ | 堆 |
| resource 名词 | /ɹɪˈzɔːs/ | 資源 /资源 |
| mechanism 名词 | /ˈmɛk.ə.nɪ.zəm/ | 機械 /机械, 機構 /机构 |
| restore 动词 | /ɹɪˈstoɹ/ | 恢復 /恢复 |
| yield 动词 | /jiːld/ | 產量 /产量, 產生 /产生 |
| resume 动词 | /ˈɹɛz.ə.meɪ/ | 恢復 /恢复, 重新開始 /重新开始 |
| pointer 名词 | /ˈpɔɪn.təɹ/ | 教鞭 |
| belong 动词 | /bɪˈlɒŋ/ | 屬於 /属于 |
| fewer | /ˈfjuː.ɚ/ | 較少 /较少, 更少 |
| trace 名词 | /tɹeɪs/ | 痕跡 /痕迹 |
| instruction 名词 | /ɪnˈstɹʌkʃən/ | 教導 /教导 |
| importantly 副词 | /ɪmˈpɔɹ.tənt.li/ | 重要的是... |
| complexity 名词 | /kəmˈplɛk.sɪ.ti/ | 複雜性 /复杂性 |
视频中出现的短语动词
| 单词 | 释义 |
|---|---|
| check out 动词 | 退房 |
需要注意的发音
- “sh” 和 “zh” 音: execution /ˌɛk.sɪˈkjuː.ʃən/, instruction /ɪnˈstɹʌkʃən/, isolation /ˌaɪsəˈleɪʃən/, malicious /məˈlɪʃəs/, malfunction /ˌmælˈfʌŋk.ʃən/
- 长单词——注意重音位置: execution /ˌɛk.sɪˈkjuː.ʃən/, mechanism /ˈmɛk.ə.nɪ.zəm/, communicate /kəˈmjuːnɪkeɪt/, importantly /ɪmˈpɔɹ.tənt.li/, complexity /kəmˈplɛk.sɪ.ti/
中文母语者容易读错的音:
- /v/ — 不要读成 /w/,上齿轻触下唇: virtual /ˈvɜɹt͡ʃuəl/, involve /ɪnˈvɑlv/
- 词尾辅音 — 要读清楚,后面不要加元音: thread /ˈθɹɛd/, stack /stæk/, resource /ɹɪˈzɔːs/, yield /jiːld/, involve /ɪnˈvɑlv/
- /r/ 和 /l/ 的区别: virtual /ˈvɜɹt͡ʃuəl/, importantly /ɪmˈpɔɹ.tənt.li/
如何用这段视频练习
- 先完整听一遍视频,不要开口,记下不认识的单词。
- 先用 0.75 倍速逐句跟读,熟练之后再回到正常速度。
- 录下自己的声音并与原声对比,特别注意 thread, execution, stack 这类单词。
什么是跟读法?
跟读法 (Shadowing) 是一种有科学依据的语言学习技巧,最初开发用于专业口译员的培训,并由多语言者Alexander Arguelles博士普及。这个方法简单而强大:您在听英语母语原声的同时立即大声重复——就像是一个延迟1-2秒紧跟说话者的影子。与被动听力或语法练习不同,跟读法强迫您的大脑和口腔肌肉同时处理并模仿真实的讲话模式。研究表明它能显着提高发音准确性,语调,节奏,连读,听力理解和口语流利度——使其成为雅思口语备考和真实英语交流最有效的方法之一。




























