Swift GCD 설명 링크들

|

Adding an API-Backed UIPageViewController in Swift

상담히 깔끔한 사이트하게 정의된 GCD 설명 사이트

GIFTBOT님(sync vs async)

[wade님-GCD 사용하기 - 그림설명 좋음 ] (https://brunch.co.kr/@tilltue/29)

http://blog.naver.com/PostView.nhn?blogId=jdub7138&logNo=220949191761&parentCategoryNo=&categoryNo=112&viewDate=&isShowPopularPosts=true&from=search

[번역]스위프트에서 동시성에대한 모든것-Part1 : 현재편: http://blog.canapio.com/128

어떤외국사이트

Threads, Queues, and More: Async Programming in iOS

https://robots.thoughtbot.com/a-simple-approach-to-thread-safe-networking-in-ios-apps

simultaneous-asynchronous-calls-in-swift](https://medium.com/@oleary.audio/simultaneous-asynchronous-calls-in-swift-9c1f5fd3ea32)

DispatchGroup with Swift

http://rolling-rabbits.com/2016/07/21/grand-central-dispatch-in-swift-3/

https://www.raywenderlich.com/5371-grand-central-dispatch-tutorial-for-swift-4-part-2-2

Alamo와 비동기 Dispatch Queue 사용하기

[Swift] 비동기 요청 끝날 때까지 기다리기(wait until get response from server) http://penguingoon.tistory.com/82

https://devminjun.github.io/blog/2-GCD

귀여운 강좌 https://zeddios.tistory.com/516 https://zeddios.tistory.com/520 ==> utilty vs userinitiated

그룹 사용법 두가지(DispatchQueue 를 이용한 다른 그룹 사용법) http://seorenn.blogspot.com/2015/08/swift-dispatch-group.html

Global Queue 기본값은 default

Global Queue의 기본 값은 default이다. 즉 아래 두 코드는 동일하다.

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

QoS

상세한 설명 레퍼런스 문서의 링크는 다음과 같다. 애플 공식 PrioritizeWorkWithQoS 링크

Queue의 기존 이름과 새로 변경된 swifty한 이름은 다음과 같다.

DISPATCH_QUEUE_PRIORITY_HIGH    >> .userInitiated
DISPATCH_QUEUE_PRIORITY_DEFAULT >> .default
DISPATCH_QUEUE_PRIORITY_LOW     >> .utility
DISPATCH_QUEUE_PRIORITY_BACKGROUND >> .background

Global Queue 와 main Queue 의 차이점에 대한 글](https://stackoverflow.com/questions/39161455/grand-central-dispatch-qos-user-interactive-vs-get-main-queue/39162201)

dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0) returns a global concurrent queue which is suitable for task that need to be done "quickly" in order to update the user interface. Tasks on this queue have a higher priority than e.g. tasks on a  QOS_CLASS_BACKGROUND queue. But this is not the main queue.

The UI update itself must be done on the main queue which you get with dispatch_get_main_queue().

아래 질문과 답의 원문 주소는 https://medium.com/the-traveled-ios-developers-guide/quality-of-service-849cd6dee1e 와 같다.

So Many Questions

To enhance your QoS journey, I’ve found it helpful to ask a series of questions. Though not all the possible grounds are exhausted, they generally cover most practices. Those questions look something like this:

  • Am I doing work that actively involves updating the UI thread, such as scrolling or loading a photo? User Interactive.
  • Am I doing work that requires user interaction? Can no meaningful progress be made until it’s completed? User initiated.
  • Am I doing work that the user isn’t aware of, like downloading some background content? Utility.
  • Am I not doing any of those? Am I cleaning up a database or doing some maintenance? Background.

추적할 게시글. 나중에 다시 봐야함.

In what sense do URLSession delegate messages “respect your QoS”? (https://stackoverflow.com/questions/51848472/in-what-sense-do-urlsession-delegate-messages-respect-your-qos)

DispatchQueue(label:xxx,qos:.yyy) vs DispatchQueue.global()

출처: https://stackoverflow.com/questions/43621952/global-vs-user-queue

let queue = DispatchQueue(label: "unique_label", qos: .userInteractive)

creates the .serial queue with high priority

let queue = DispatchQueue.global()

doesn’t actually create nothing but returns global (system) .concurrent queue with qos .default.

어떤이가 시험한 QoS에 따른 속도차이

The 5 queues (4 background, 1 main) all have different thread priorities (-[NSThread threadPriority\]) too:

                            -main- : 0.758065
      DISPATCH_QUEUE_PRIORITY_HIGH : 0.532258
   DISPATCH_QUEUE_PRIORITY_DEFAULT : 0.500000
       DISPATCH_QUEUE_PRIORITY_LOW : 0.467742
DISPATCH_QUEUE_PRIORITY_BACKGROUND : 0.000000

(tested on an iPod 4th gen and the simulator on a MacBook Pro)

출처: https://stackoverflow.com/questions/9602042/whats-the-difference-between-the-global-queue-and-the-main-queue-in-gcd

Comments