Recent Posts
Recent Comments
반응형
«   2025/08   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
Archives
Today
Total
관리 메뉴

오늘도 공부

background thread 종류 본문

IOS

background thread 종류

행복한 수지아빠 2017. 7. 14. 10:34
반응형

Creating a concurrent queue

let concurrentQueue = DispatchQueue(label: "queuename", attributes: .concurrent)
concurrentQueue.sync {

}  

Create a serial queue

let serialQueue = DispatchQueue(label: "queuename")
serialQueue.sync { 

}

Get main queue asynchronously

DispatchQueue.main.async {

}

Get main queue synchronously

DispatchQueue.main.sync {

}

To get one of the background thread

DispatchQueue.global(attributes: .qosDefault).async {

}

Xcode 8.2 beta 2:

To get one of the background thread

DispatchQueue.global(qos: .default).async {

}

DispatchQueue.global().async {
    // qos' default value is ´DispatchQoS.QoSClass.default`
}

If you want to learn about using these queues .See this answer

반응형

'IOS' 카테고리의 다른 글

xcode 인덱싱 비활성화..  (0) 2017.08.04
array union, intersection 관련내용  (0) 2017.06.30
xcode pod 파일들이 엉켰을때..  (0) 2017.06.29
스위프트 공부 참고 사이트  (0) 2017.04.10
스위프트 추천 기술들  (0) 2017.04.10