【发布时间】:2014-05-08 11:37:33
【问题描述】:
我是 GCD 的新手,所以希望我在这里有正确的想法,但需要一些建议......
我有一个应用需要在后台进行一些渲染处理以保持性能。所以我使用下面的代码.... ('ish)
dispatch_queue_t renderQueue = dispatch_queue_create("myLongRunningProcess", NULL);
dispatch_async(renderQueue, ^{
/* Perform several long running rendering processes which could */
/* take 2-3 seconds in total */
});
由于这是多个操作的长时间运行过程,可能需要通过主线程上的用户交互再次重新启动渲染过程。
那么,我怎样才能通知这个进程重新启动,或者形成某种队列和标志机制,这会导致这个进程中止并允许重新启动渲染。
感谢您的帮助和建议。
【问题讨论】:
标签: ios queue grand-central-dispatch long-running-processes