Parallel processing Swift是否有通过Grand Central Dispatch';什么是异步调度?

Parallel processing Swift是否有通过Grand Central Dispatch';什么是异步调度?,parallel-processing,grand-central-dispatch,swift,Parallel Processing,Grand Central Dispatch,Swift,我对采用新的Swift编程语言感兴趣。我维护的代码基础通过C++ Grand中央调度扩展(DeXPuxAsic等)广泛使用多核处理。 任何看过Swift的人都知道这种语言是否能够以类似的方式访问GCD吗?我没有在Swift中与他们合作过,但Swift似乎可以使用GCD的功能。是的,尽管我在操场上没有太多成功。在实际的项目中,它应该是有效的。所有iOS 8和OS X 10.10文档都显示了GCD方法的快速语法 在我当前的项目中,我对单身人士使用了一次dispatch\u,效果很好: NSOpera

我对采用新的Swift编程语言感兴趣。我维护的代码基础通过C++ Grand中央调度扩展(DeXPuxAsic等)

广泛使用多核处理。
任何看过Swift的人都知道这种语言是否能够以类似的方式访问GCD吗?

我没有在Swift中与他们合作过,但Swift似乎可以使用GCD的功能。

是的,尽管我在操场上没有太多成功。在实际的项目中,它应该是有效的。所有iOS 8和OS X 10.10文档都显示了GCD方法的快速语法

在我当前的项目中,我对单身人士使用了一次
dispatch\u
,效果很好:

NSOperation
NSOperationQueue
都在引擎盖下使用GCD,在操场上似乎效果更好:

let operationQueue = NSOperationQueue()

for index in 1...20
{
    operationQueue.addOperationWithBlock(
    {
        let thread = NSThread.currentThread()
        let threadNumber = thread.valueForKeyPath("private.seqNum").integerValue

        println("Task #\(index) completed on thread #\(threadNumber)")
    })
}
输出:

Task #1 completed on thread #3
Task #2 completed on thread #4
Task #3 completed on thread #5
Task #4 completed on thread #4
Task #5 completed on thread #5
Task #6 completed on thread #3
Task #7 completed on thread #6
Task #8 completed on thread #4
Task #9 completed on thread #5
Task #10 completed on thread #5
Task #11 completed on thread #3
Task #12 completed on thread #6
Task #13 completed on thread #3
Task #14 completed on thread #3
Task #15 completed on thread #6
Task #16 completed on thread #5
Task #17 completed on thread #4
Task #18 completed on thread #3
Task #19 completed on thread #4
Task #20 completed on thread #3

好极了,这听起来是一个非常积极的线索,我要试一试。谢谢公平地说,这个功能是通过基础库公开的,而不是Swift语言的本源。