Terminology
- The term thread is used to refer to a separate path of execution for code.
- The term process is used to refer to a running executable, which can encompass multiple threads.
- The term task is used to refer to the abstract concept of work that needs to be performed.
Concurrency and Application Design
1. Grand Central Dispatch (GCD) takes the thread management code you would normally write in your own applications and moves that code down to the system level. All you have to do is define the tasks you want to execute and add them to an appropriate dispatch queue. GCD takes care of creating the needed threads and of scheduling your tasks to run on those threads.
2. Operation queues are Objective-C objects that act very much like dispatch queues. You define the tasks you want to execute and then add them to an operation queue, which handles the scheduling and execution of those tasks. Like GCD, operation queues handle all of the thread management for you, ensuring that tasks are executed as quickly and as efficiently as possible on the system.
本文深入探讨了并发与应用设计领域的关键概念,重点介绍了Grand Central Dispatch (GCD) 和操作队列的功能,阐述了它们如何简化线程管理,确保任务高效执行。
2282

被折叠的 条评论
为什么被折叠?



