Why should I choose GCD over NSOperation and blocks for high-level applications?

前端 未结 5 1196
既然无缘
既然无缘 2020-12-07 12:19

Apple\'s Grand Central Dispatch reference says:

\"...if your application needs to operate at the Unix level of the system—for example, if it needs t

5条回答
  •  粉色の甜心
    2020-12-07 12:50

    Well, NSOperation has no equivalents to dispatch_source_t, dispatch_io, dispatch_data_t, dispatch_semaphore_t, etc... It's also somewhat higher overhead.

    On the flip side, libdispatch has no equivalents to operation dependencies, operation priorities (queue priorities are somewhat different), or KVO on operations.

提交回复
热议问题