2-2THREADS

2-2 THREADS

In many situations, multiple threads of control in the same address are needed,as they will run in quasi-parallel and keep independent.

2-2-1 Thread Usage

4 Reasons for having threads

  • The ability for parallel entities to share an address space and all of its data among themselves.
  • Lighter weight than processes,easy to create and destory
  • Computing activities overlap,speed up the application
  • Multiple CPUS

Add three threads for a word processor.

One interacts with the user ,one handles reformatting in the background, the another one handle disk backups.

image-20230920173837437


2-2THREADS
http://example.com/2023/09/20/2-2THREADS/
Author
WYX
Posted on
September 20, 2023
Licensed under