📜  python 线程与多处理 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:45.767000             🧑  作者: Mango

代码示例1
The Python threading module uses threads instead of processes.
Threads uniquely run in the same unique memory heap.
Whereas Processes run in separate memory heaps.
This makes sharing information harder with processes and object instances.
One problem arises because threads use the same memory heap,
multiple threads can write to the same location in the memory heap
which is why the global interpreter lock(GIL) in CPython was created
as a mutex to prevent it from happening.