Skip to content

Latest commit

ย 

History

History
33 lines (27 loc) ยท 3.78 KB

qos.md

File metadata and controls

33 lines (27 loc) ยท 3.78 KB

Global DispatchQueue ์˜ Qos ์—๋Š” ์–ด๋–ค ์ข…๋ฅ˜๊ฐ€ ์žˆ๋Š”์ง€, ๊ฐ๊ฐ ์–ด๋–ค ์˜๋ฏธ์ธ์ง€ ์„ค๋ช…ํ•˜์‹œ์˜ค.

๋„์›€์ด ๋œ ๊ธ€

Answer

priority๊ฐ€ ๋†’์€ ์ž‘์—…์€ ์šฐ์„ ์ˆœ์œ„๊ฐ€ ๋‚ฎ์€ ์ž‘์—…๋ณด๋‹ค ๋” ๋นจ๋ฆฌ ์ˆ˜ํ–‰๋˜๊ณ  ๋ฆฌ์†Œ์Šค๊ฐ€ ๋งŽ์œผ๋ฏ€๋กœ ์ผ๋ฐ˜์ ์œผ๋กœ priority๊ฐ€ ๋‚ฎ์€ ์ž‘์—…๋ณด๋‹ค ๋” ๋งŽ์€ ์—๋„ˆ์ง€๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ์•ฑ์ด ์ˆ˜ํ–‰ํ•˜๋Š” ์ž‘์—…์— ๋Œ€ํ•ด ์ ์ ˆํ•œ QoSํด๋ž˜์Šค๋ฅผ ์ •ํ™•ํ•˜๊ฒŒ ์ง€์ •ํ•˜๋ฉด, ์•ฑ์ด ์—๋„ˆ์ง€ ํšจ์œจ์ ์ผ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ, ๋ฐ˜์‘์ ์ž„์„ ๋ณด์žฅ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ข…๋ฅ˜

  • 4๊ฐœ์˜ primary QoS class
    • User-interactive
    • User-initiated
    • Utility
    • Background
  • 2๊ฐœ์˜ Special Quality of Service Classes

    ๋Œ€๋ถ€๋ถ„์˜ ๊ฒฝ์šฐ ์ด ๋‘๊ฐœ์˜ ํด๋ž˜์Šค์— ๋…ธ์ถœ๋  ์ผ์€ ์—†๋‹ค๊ณ  ํ•œ๋‹ค.

    • Default
    • Unspecified
Type Qos Class Type of work and focus of QoS Duration of work to be performed
Primary User-interactive main thread์—์„œ ๋™์ž‘ํ•˜๊ฑฐ๋‚˜ UI๋ฅผ ์ƒˆ๋กœ๊ณ ์นจํ•˜๊ฑฐ๋‚˜ ์• ๋‹ˆ๋ฉ”์ด์…˜์„ ์ˆ˜ํ–‰ํ•˜๋Š” ๋“ฑ ์‚ฌ์šฉ์ž์™€ ์ƒํ˜ธ์ž‘์šฉ ํ•˜๋Š” ์ž‘์—…์ž…๋‹ˆ๋‹ค. ๋งŒ์•ฝ ์ž‘์—…์ด ์‹ ์†ํ•˜๊ฒŒ ์ˆ˜ํ–‰๋˜์ง€ ์•Š์œผ๋ฉด UI๊ฐ€ ๋ฉˆ์ถฐ๋ณด์ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋ฐ˜์‘์„ฑ๊ณผ ์„ฑ๋Šฅ์— ์ค‘์ ์„ ๋‘ก๋‹ˆ๋‹ค. ์ž‘์—… ์‹œ๊ฐ„์€ ๊ฑฐ์˜ ์ฆ‰๊ฐ์ ์ž…๋‹ˆ๋‹ค.
Primary User-initiated ์‚ฌ์šฉ์ž๊ฐ€ ์‹œ์ž‘ํ–ˆ๋˜ ์ž‘์—… ๊ทธ๋ฆฌ๊ณ  ์ฆ‰๊ฐ์ ์ธ ๊ฒฐ๊ณผ๊ฐ€ ์š”๊ตฌ๋˜๋Š” ์ž‘์—…์ž…๋‹ˆ๋‹ค. ์ €์žฅ๋œ ๋ฌธ์„œ๋ฅผ ์—ด๊ฑฐ๋‚˜ ์‚ฌ์šฉ์ž๊ฐ€ UI์— ์กด์žฌํ•˜๋Š” ์–ด๋–ค ๊ฒƒ์„ ํด๋ฆญํ•˜์—ฌ ์•ก์…˜์ด ๋ฐœ์ƒํ•˜๋Š” ๋“ฑ์˜ ์ž‘์—…์ด ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. UI๋ฅผ ๊ณ„์†ํ•ด์„œ ์ง„ํ–‰๋˜๊ฒŒ ํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” ๊ทธ ์ž‘์—…์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ๋ฐ˜์‘์„ฑ๊ณผ ์„ฑ๋Šฅ์— ์ค‘์ ์„ ๋‘ก๋‹ˆ๋‹ค. ์ž‘์—…์€ ๋ช‡ ์ดˆ ์ดํ•˜์™€ ๊ฐ™์ด ๊ฑฐ์˜ ์ฆ‰๊ฐ์ ์ž…๋‹ˆ๋‹ค.
Primary Utility ์™„๋ฃŒ๊นŒ์ง€ ์•ฝ๊ฐ„์˜ ์‹œ๊ฐ„์ด ๊ฑธ๋ฆฌ๊ฑฐ๋‚˜ ์ฆ‰๊ฐ์ ์ธ ๊ฒฐ๊ณผ๊ฐ€ ์š”๊ตฌ๋˜์ง€ ์•Š๋Š” ์ž‘์—…์ž…๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ๋ฅผ ๋‹ค์šด๋กœ๋“œํ•˜๊ฑฐ๋‚˜ ๋‚ด๋ณด๋‚ด๋Š” ๋“ฑ์˜ ์ž‘์—…์ด ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. Utility ์ž‘์—…๋“ค์€ ์ผ๋ฐ˜์ ์œผ๋กœ ์‚ฌ์šฉ์ž์—๊ฒŒ ๋ณด์—ฌ์ง€๋Š” ์ง„ํ–‰ ๋ง‰๋Œ€๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๋ฐ˜์‘์„ฑ, ์„ฑ๋Šฅ ๋ฐ ์—๋„ˆ์ง€ ํšจ์œจ์„ฑ ๊ฐ„์— ๊ท ํ˜•์„ ์œ ์ง€ํ•˜๋Š” ๋ฐ ์ค‘์ ์„ ๋‘ก๋‹ˆ๋‹ค. ์ž‘์—…์€ ๋ช‡ ์ดˆ์—์„œ ๋ช‡ ๋ถ„์ด ์†Œ์š”๋ฉ๋‹ˆ๋‹ค.
Primary Background Background์—์„œ ์ˆ˜ํ–‰๋˜๋ฉฐ ์‚ฌ์šฉ์ž์—๊ฒŒ ๋ณด์—ฌ์ง€์ง€ ์•Š๋Š” ์ž‘์—…์ž…๋‹ˆ๋‹ค. ์ด๋ฅผํ…Œ๋ฉด indexing, ๋™๊ธฐํ™” ๋ฐ ๋ฐฑ์—… ๋“ฑ์˜. ์—๋„ˆ์ง€ ํšจ์œจ์„ฑ์— ์ค‘์ ์„ ๋‘ก๋‹ˆ๋‹ค. ์ž‘์—…์— ์ƒ๋‹นํ•œ ์‹œ๊ฐ„์ด ์†Œ์š”๋ฉ๋‹ˆ๋‹ค. ์ˆ˜ ๋ถ„์—์„œ ์ˆ˜ ์‹œ๊ฐ„.
Special Default ์ด QoS์˜ priority level์€ user-initiated์™€ utility์‚ฌ์ด์— ์žˆ์Šต๋‹ˆ๋‹ค. ์ด QoS๋Š” ๊ฐœ๋ฐœ์ž๊ฐ€ ์ž‘์—…์„ ๋ถ„๋ฅ˜ํ•˜๋Š”๋ฐ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•œ ๊ฒƒ์ด ์•„๋‹™๋‹ˆ๋‹ค. QoS์ •๋ณด๊ฐ€ ํ• ๋‹น๋˜์ง€ ์•Š์€ ์ž‘์—…์€ Default๋กœ ์ฒ˜๋ฆฌ๋˜๋ฉฐ GCD global queue๋Š” ์ด level(default)์—์„œ ์‹คํ–‰๋ฉ๋‹ˆ๋‹ค. -
Special Unspecified ์ด๋Š” QoS์ •๋ณด๊ฐ€ ์—†์Œ์„ ๋‚˜ํƒ€๋‚ด๋ฉฐ, ํ™˜๊ฒฝ QoS(environmental QoS)๋ฅผ ์ถ”๋ก ํ•ด์•ผ ํ•œ๋‹ค๋Š” ๋‹จ์„œ๋ฅผ ์‹œ์Šคํ…œ์— ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์“ฐ๋ ˆ๋“œ๊ฐ€ ๊ธฐ์กด(legacy) API๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ, Unspecified QoS๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ, ์ด๊ฒฝ์šฐ ์“ฐ๋ ˆ๋“œ๊ฐ€ QoS๋ฅผ ๋ฒ—์–ด๋‚  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. -