您的位置:首页 > 理论基础

计算机基础知识问答

2012-11-25 11:30 232 查看
线程和进程的区别和联系(What's the difference between process and thread? What kind of information does thread maintain? its own stack? heap?How and when to do a context switch? How do you handle an time slice interrupt?What are the possible pitfalls for multi-thread programming?)
Diff threads in the same process share the same address space. Different processes do not.
Different threads have their own stack. as do different processes. Thread switch is like a jump in the code since no TLB flush is required. Context switch happens when the processor schedules a new process to execute. (TLB:Translation lookaside buffer,即旁路转换缓冲,或称为页表缓冲;里面存放的是一些页表文件(虚拟地址到物理地址的转换表))
Possible pitfalls for mt : locking, synchronization
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: