美文网首页
多线程之常见问题

多线程之常见问题

作者: zyangela | 来源:发表于2019-08-15 21:22 被阅读0次

死锁产生条件

  1. Mutual Exclusion: Only one process can access a resource at a given time. Or, more accurately, there is limited access to a resource. A deadlock could also occur if a resource has limited quantity.
  2. Hold and wait: Processes already holding a resource can request additional resources, without relinquishing their current resources
  3. No preemption: One process cannot forcibly remove another process' resource
  4. Circular wait: Two or more processes form a circular chain where each process is waiting on another resource in the chain

Questions:

Thread vs. Process

Difference between thread and process

Context Switch

How would you measure the time spent in a context switch?

Dining Philosophers

Deadlock-Free Class

扩展阅读

ping pong测试

相关文章

网友评论

      本文标题:多线程之常见问题

      本文链接:https://www.haomeiwen.com/subject/udbtsctx.html