Abstract


Benefits


Improved Responsiveness

  • Can continue to run other Thread while waiting for I/O operations to complete
  • Run other Thread while one Thread is waiting

Improved Performance

  • When tasks are stateless, independent of each other & long waiting time incurs in the task

Cons


More likely to get Race Condition (竞态条件)

  • Where there is a shared resource

More likely to get Deadlock (死锁)

  • Where there is a shared resource

Overhead of Creating Thread

Terminologies


Thread Safety (线程安全)

Multi-threaded Chip