Upgrade to Pro — share decks privately, control downloads, hide ads and more …

ConcurrencyWithGCD

Takanori Hirobe
September 06, 2020

 ConcurrencyWithGCD

近年のモバイルデバイスのプロセッサはマルチコア化が進んでおり、iOSデバイスも例外ではありません。たとえば、最新のiPhoneには6つのコアが搭載されています。

今後もコアが増えていくことは確実で、iOSエンジニアである私たちにとって多くのコアを活かすための知見はますます重要になっています。

そこで、このトークではGrand Central DispatchとSwiftを使ってソートや探索といった基本的なアルゴリズムを並行化する手法を学び、コアをもっと有効に使うための考え方を説明します。

このトークを観て、Grand Central Dispatchを使ったマルチスレッドプログラミングの新たな可能性に触れてみましょう。

Takanori Hirobe

September 06, 2020
Tweet

More Decks by Takanori Hirobe

Other Decks in Programming

Transcript

  1. ࣗݾ঺հ • ኍ෦ وಙ( Takanori Hirobe ) • Twitter, Github,

    Qiita: @taka1068 • ϑΣϯϦϧגࣜձࣾॴଐ
  2. ࣗݾ঺հ • ኍ෦ وಙ( Takanori Hirobe ) • Twitter, Github,

    Qiita: @taka1068 • ϑΣϯϦϧגࣜձࣾॴଐ ϓϥνφεϙϯαʔ
  3. ϕϯνϚʔΫ • 36ϲࠃޠͷѫࡰͷcountΛ߹ܭ - 5ճଌఆͨ͠ฏۉ஋Ͱ͢ɻ - εϥΠυʹ৐ͤͨίʔυ͸આ໌༻Ͱ͢ɻ࣮ࡍʹଌఆʹར༻ͨ͠ίʔυ͸Githubʹ͋Γ·͢ɻ - MacBook Pro

    15-inch, 2018, Core i9 2.9 GHz. - macOS Catalina 10.15.6, Swift 5.2.4, ࠷దԽ͋Γ ( -O ) Array.map concurrentMap 0.00024 seconds 0.00064 seconds
  4. ϕϯνϚʔΫ • 36ϲࠃޠͷѫࡰͷcountΛ߹ܭ - 5ճଌఆͨ͠ฏۉ஋Ͱ͢ɻ - εϥΠυʹ৐ͤͨίʔυ͸આ໌༻Ͱ͢ɻ࣮ࡍʹଌఆʹར༻ͨ͠ίʔυ͸Githubʹ͋Γ·͢ɻ - MacBook Pro

    15-inch, 2018, Core i9 2.9 GHz. - macOS Catalina 10.15.6, Swift 5.2.4, ࠷దԽ͋Γ ( -O ) Array.map concurrentMap 0.00024 seconds 0.00064 seconds 0 sec 0.001 sec Array.map concurrentMap
  5. ϕϯνϚʔΫ • 36ϲࠃޠͷѫࡰͷcountΛ߹ܭ • ฒߦԽͨ͠ͷʹ஗͘ͳ͍ͬͯΔ - 5ճଌఆͨ͠ฏۉ஋Ͱ͢ɻ - εϥΠυʹ৐ͤͨίʔυ͸આ໌༻Ͱ͢ɻ࣮ࡍʹଌఆʹར༻ͨ͠ίʔυ͸Githubʹ͋Γ·͢ɻ -

    MacBook Pro 15-inch, 2018, Core i9 2.9 GHz. - macOS Catalina 10.15.6, Swift 5.2.4, ࠷దԽ͋Γ ( -O ) Array.map concurrentMap 0.00024 seconds 0.00064 seconds 0 sec 0.001 sec Array.map concurrentMap
  6. ίΞ0 ίΞ1 ίΞ2 ίΞ3 .count .count .count .count ഑ྻ΁ͷ୅ೖ ഑ྻ΁ͷ୅ೖ

    ഑ྻ΁ͷ୅ೖ ഑ྻ΁ͷ୅ೖ Overhead Overhead Overhead .count .count .count .count Overhead ഑ྻ΁ͷ୅ೖ Overhead Overhead ࣌ؒ
  7. ίΞ0 ίΞ1 ίΞ2 ίΞ3 .count .count .count .count ഑ྻ΁ͷ୅ೖ ഑ྻ΁ͷ୅ೖ

    ഑ྻ΁ͷ୅ೖ ഑ྻ΁ͷ୅ೖ Overhead Overhead Overhead .count .count .count .count Overhead ഑ྻ΁ͷ୅ೖ Overhead Overhead ͋ΔॠؒͰͷ഑ྻ΁ͷ୅ೖ͸ɺ
 1ͭͷεϨου͔͠ڐ͞Εͳ͍ ࣌ؒ
  8. ίΞ0 ίΞ1 ίΞ2 ίΞ3 .count .count .count .count Overhead Overhead

    Overhead .count .count .count Overhead Overhead Overhead ͋ΔॠؒͰͷ഑ྻ΁ͷ୅ೖ͸ɺ
 1ͭͷεϨου͔͠ڐ͞Εͳ͍ ࣌ؒ ഑ྻ΁ͷ୅ೖ ഑ྻ΁ͷ୅ೖ ഑ྻ΁ͷ୅ೖ .count ഑ྻ΁ͷ୅ೖ ഑ྻ΁ͷ୅ೖ
  9. ίΞ0 ίΞ1 ίΞ2 ίΞ3 .count .count .count .count ഑ྻ΁ͷ୅ೖ ഑ྻ΁ͷ୅ೖ

    ഑ྻ΁ͷ୅ೖ ഑ྻ΁ͷ୅ೖ Overhead Overhead Overhead .count .count .count .count Overhead ഑ྻ΁ͷ୅ೖ Overhead Overhead ଞͷεϨου͕ॻ͖ࠐΜͰ͍Δ࣌ɺ
 ͦΕ͕ऴΘΔ·Ͱ଴ͭඞཁ͕͋Δ ࣌ؒ
  10. ίΞ0 ίΞ1 ίΞ2 ίΞ3 .count .count .count .count ഑ྻ΁ͷ୅ೖ ഑ྻ΁ͷ୅ೖ

    ഑ྻ΁ͷ୅ೖ ഑ྻ΁ͷ୅ೖ Overhead Overhead Overhead .count .count .count .count Overhead ഑ྻ΁ͷ୅ೖ Overhead Overhead ଞͷεϨου͕ॻ͖ࠐΜͰ͍Δ࣌ɺ
 ͦΕ͕ऴΘΔ·Ͱ଴ͭඞཁ͕͋Δ ଴ͪ࣌ؒ: Φʔόʔϔου ࣌ؒ
  11. ίΞ0 ίΞ1 ίΞ2 ίΞ3 .count .count .count .count ഑ྻ΁ͷ୅ೖ ഑ྻ΁ͷ୅ೖ

    ഑ྻ΁ͷ୅ೖ ഑ྻ΁ͷ୅ೖ Overhead Overhead Overhead .count .count .count .count Overhead ഑ྻ΁ͷ୅ೖ Overhead Overhead ଞͷεϨου͕ॻ͖ࠐΜͰ͍Δ࣌ɺ
 ͦΕ͕ऴΘΔ·Ͱ଴ͭඞཁ͕͋Δ ଴ͪ࣌ؒ: Φʔόʔϔου ࣌ؒ
  12. ίΞ0 ίΞ1 ίΞ2 ίΞ3 .count .count .count .count ഑ྻ΁ͷ୅ೖ ഑ྻ΁ͷ୅ೖ

    ഑ྻ΁ͷ୅ೖ ഑ྻ΁ͷ୅ೖ Overhead Overhead Overhead .count .count .count .count Overhead ഑ྻ΁ͷ୅ೖ Overhead Overhead ฒߦԽͷԸܙΑΓ Φʔόʔϔουͷํ͕ϖφϧςΟ͕େ͖͍ ࣌ؒ
  13. ίΞ0 ίΞ1 ίΞ2 ίΞ3 .count .count .count .count ഑ྻ΁ͷ୅ೖ ഑ྻ΁ͷ୅ೖ

    ഑ྻ΁ͷ୅ೖ ഑ྻ΁ͷ୅ೖ Overhead Overhead Overhead .count .count .count .count Overhead ഑ྻ΁ͷ୅ೖ Overhead Overhead < Ըܙ ϖφϧςΟ ࣌ؒ
  14. ίΞ0 ίΞ1 ίΞ2 ίΞ3 .count .count .count .count ഑ྻ΁ͷ୅ೖ ഑ྻ΁ͷ୅ೖ

    ഑ྻ΁ͷ୅ೖ ഑ྻ΁ͷ୅ೖ Overhead Overhead Overhead .count .count .count .count Overhead ഑ྻ΁ͷ୅ೖ Overhead Overhead ҰͭҰͭͷλεΫ ͕খ͗͢͞Δ ࣌ؒ
  15. ίΞ0 ίΞ1 ίΞ2 ίΞ3 λεΫ λεΫ λεΫ λεΫ Overhead Overhead

    Overhead λεΫ λεΫ λεΫ ഑ྻ΁ͷ୅ೖ ഑ྻ΁ͷ୅ೖ ഑ྻ΁ͷ୅ೖ ഑ྻ΁ͷ୅ೖ λεΫ ࣌ؒ
  16. ίΞ0 ίΞ1 ίΞ2 ίΞ3 λεΫ λεΫ λεΫ λεΫ Overhead Overhead

    Overhead λεΫ λεΫ λεΫ ഑ྻ΁ͷ୅ೖ ഑ྻ΁ͷ୅ೖ ഑ྻ΁ͷ୅ೖ ഑ྻ΁ͷ୅ೖ λεΫ > Ըܙ ϖφϧςΟ Φʔόʔϔουͷ઎ΊΔׂ߹ΛݮΒ͢ ࣌ؒ
  17. ॏ͍ॲཧͰϕϯνϚʔΫ • Ն໨ᕸੴͷʮ͜͜Ζʯͷ๯಄ͷ 57631 จࣈ͔Β׽ࣈͷݸ਺ΛΧ΢ϯτ • ഑ྻͷཁૉʹ͸1ஈམΛ·Δ͝ͱೖΕͯܭଌ - 5ճଌఆͨ͠ฏۉ஋Ͱ͢ɻ -

    εϥΠυʹ৐ͤͨίʔυ͸આ໌༻Ͱ͢ɻ
 ࣮ࡍʹଌఆʹར༻ͨ͠ίʔυ͸Githubʹ͋Γ·͢ɻ - MacBook Pro 15-inch, 2018, Core i9 2.9 GHz. - macOS Catalina 10.15.6, Swift 5.2.4, ࠷దԽ͋Γ ( -O ) Array.map concurrentMap 0.0082 seconds 0.0047 seconds
  18. ॏ͍ॲཧͰϕϯνϚʔΫ • Ն໨ᕸੴͷʮ͜͜Ζʯͷ๯಄ͷ 57631 จࣈ͔Β׽ࣈͷݸ਺ΛΧ΢ϯτ • ഑ྻͷཁૉʹ͸1ஈམΛ·Δ͝ͱೖΕͯܭଌ - 5ճଌఆͨ͠ฏۉ஋Ͱ͢ɻ -

    εϥΠυʹ৐ͤͨίʔυ͸આ໌༻Ͱ͢ɻ
 ࣮ࡍʹଌఆʹར༻ͨ͠ίʔυ͸Githubʹ͋Γ·͢ɻ - MacBook Pro 15-inch, 2018, Core i9 2.9 GHz. - macOS Catalina 10.15.6, Swift 5.2.4, ࠷దԽ͋Γ ( -O ) Array.map concurrentMap 0.0082 seconds 0.0047 seconds 0 sec 0.01 sec Array.map concurrentMap
  19. array 0 14 1 2 3 4 5 6 7

    8 9 10 11 12 13 59 75 92 99 77 15 13 2 68 31 83 35 67 51 70
  20. array 0 14 1 2 3 4 5 6 7

    8 9 10 11 12 13 59 75 92 99 77 15 13 2 68 31 83 35 67 51 70 pivot
  21. array 0 14 1 2 3 4 5 6 7

    8 9 10 11 12 13 59 75 92 99 77 15 13 2 68 31 83 35 67 51 70 array 0 14 1 2 3 4 5 6 7 8 9 10 11 12 13 15 13 92 2 31 35 51 59 75 99 77 68 83 67 70 Partition
  22. array 0 14 1 2 3 4 5 6 7

    8 9 10 11 12 13 59 75 92 99 77 15 13 2 68 31 83 35 67 51 70 array 0 14 1 2 3 4 5 6 7 8 9 10 11 12 13 15 13 92 2 31 35 51 59 75 99 77 68 83 67 70 <= 59 Partition
  23. array 0 14 1 2 3 4 5 6 7

    8 9 10 11 12 13 59 75 92 99 77 15 13 2 68 31 83 35 67 51 70 array 0 14 1 2 3 4 5 6 7 8 9 10 11 12 13 15 13 92 2 31 35 51 59 75 99 77 68 83 67 70 <= 59 59 < Partition
  24. array 0 1 2 3 4 5 15 13 2

    31 35 51 14 7 8 9 10 11 12 13 92 75 99 77 68 83 67 70
  25. array 0 1 2 3 4 5 15 13 2

    31 35 51 14 7 8 9 10 11 12 13 92 75 99 77 68 83 67 70 pivot pivot
  26. array 0 1 2 3 4 5 15 13 2

    31 35 51 Partition 14 7 8 9 10 11 12 13 92 75 99 77 68 83 67 70 Partition
  27. array 0 1 2 3 4 5 15 13 2

    31 35 51 Partition array 0 1 2 3 4 5 2 13 15 31 35 51 14 7 8 9 10 11 12 13 92 75 99 77 68 83 67 70 Partition 14 7 8 9 10 11 12 13 99 67 68 70 75 77 83 92
  28. array 0 1 2 3 4 5 15 13 2

    31 35 51 Partition array 0 1 2 3 4 5 2 13 15 31 35 51 14 7 8 9 10 11 12 13 92 75 99 77 68 83 67 70 Partition 14 7 8 9 10 11 12 13 99 67 68 70 75 77 83 92
  29. 59 99 75 92 15 13 2 31 35 68

    83 67 51 70 77 a 0 14 1 2 3 4 5 6 7 8 9 10 11 12 13 15 2 13 31 35 51 59 99 35 75 83 67 51 70 77 a 0 14 1 2 3 4 5 6 7 8 9 10 11 12 13 2 15 13 31 35 51 a 0 1 2 3 4 5 68 75 67 70 92 83 77 99 14 7 8 9 10 11 12 13 a 2 13 a 0 1 31 35 51 3 4 5 35 51 4 5 51 5 13 1 68 67 70 7 8 9 68 70 8 9 70 9 83 77 92 99 14 11 12 13 99 14 77 83 11 12 83 12
  30. 59 99 75 92 15 13 2 31 35 68

    83 67 51 70 77 a 0 14 1 2 3 4 5 6 7 8 9 10 11 12 13 15 2 13 31 35 51 99 35 75 83 67 51 70 77 a 0 14 1 2 3 4 5 6 7 8 9 10 11 12 13 2 13 31 35 51 a 0 1 2 3 4 5 68 67 70 92 83 77 99 14 7 8 9 10 11 12 13 a 13 a 0 1 35 51 3 4 5 51 4 5 5 1 68 70 7 8 9 70 8 9 9 83 77 99 14 11 12 13 14 83 11 12 12 59 15 75 2 31 35 51 13 67 68 70 92 99 77 83
  31. 59 99 75 92 15 13 2 31 35 68

    83 67 51 70 77 a 0 14 1 2 3 4 5 6 7 8 9 10 11 12 13 15 2 13 31 35 51 59 99 35 75 83 67 51 70 77 a 0 14 1 2 3 4 5 6 7 8 9 10 11 12 13 2 15 13 31 35 51 a 0 1 2 3 4 5 68 75 67 70 92 83 77 99 14 7 8 9 10 11 12 13 a 2 13 a 0 1 31 35 51 3 4 5 35 51 4 5 51 5 13 1 68 67 70 7 8 9 68 70 8 9 70 9 83 77 92 99 14 11 12 13 99 14 77 83 11 12 83 12
  32. 59 99 75 92 15 13 2 31 35 68

    83 67 51 70 77 a 0 14 1 2 3 4 5 6 7 8 9 10 11 12 13 15 2 13 31 35 51 59 99 35 75 83 67 51 70 77 a 0 14 1 2 3 4 5 6 7 8 9 10 11 12 13 2 15 13 31 35 51 a 0 1 2 3 4 5 68 75 67 70 92 83 77 99 14 7 8 9 10 11 12 13 a 2 13 a 0 1 31 35 51 3 4 5 35 51 4 5 51 5 13 1 68 67 70 7 8 9 68 70 8 9 70 9 83 77 92 99 14 11 12 13 99 14 77 83 11 12 83 12
  33. 15 2 13 31 35 51 99 35 75 83

    67 51 70 77 a 0 14 1 2 3 4 5 7 8 9 10 11 12 13 2 15 13 31 35 51 a 0 1 2 3 4 5 68 75 67 70 92 83 77 99 14 7 8 9 10 11 12 13 a 2 13 a 0 1 31 35 51 3 4 5 35 51 4 5 51 5 13 1 68 67 70 7 8 9 68 70 8 9 70 9 83 77 92 99 14 11 12 13 99 14 77 83 11 12 83 12 2ͭͷಠཱͨ͠ΫΠοΫιʔτ
  34. 2 15 13 31 35 51 a 0 1 2

    3 4 5 68 75 67 70 92 83 77 99 14 7 8 9 10 11 12 13 a 2 13 a 0 1 31 35 51 3 4 5 35 51 4 5 51 5 13 1 68 67 70 7 8 9 68 70 8 9 70 9 83 77 92 99 14 11 12 13 99 14 77 83 11 12 83 12 4ͭͷಠཱͨ͠ΫΠοΫιʔτ
  35. ϕϯνϚʔΫ • 1ԯݸͷϥϯμϜͳ੔਺ͷ഑ྻΛιʔτ ඪ४ϥΠϒϥϦ
 Array.sort() ௚ྻ൛ ΫΠοΫιʔτ ฒߦ൛ ΫΠοΫιʔτ 10.3

    seconds 9.0 seconds 8.1 seconds - 5ճଌఆͨ͠ฏۉ஋Ͱ͢ɻ - εϥΠυʹ৐ͤͨίʔυ͸આ໌༻Ͱ͢ɻ࣮ࡍʹଌఆʹར༻ͨ͠ίʔυ͸Githubʹ͋Γ·͢ɻ - MacBook Pro 15-inch, 2018, Core i9 2.9 GHz. - macOS Catalina 10.15.6, Swift 5.2.4, ࠷దԽ͋Γ ( -O )
  36. ࣌ؒ 0 sec 2 sec 4 sec 6 sec 8

    sec 10 sec 12 sec Array.sort() ௚ྻΫΠοΫιʔτ ฒߦΫΠοΫιʔτ
  37. ࣌ؒ 0 sec 2 sec 4 sec 6 sec 8

    sec 10 sec 12 sec Array.sort() ௚ྻΫΠοΫιʔτ ฒߦΫΠοΫιʔτ ໿10ඵ ໿9ඵ ໿8ඵ
  38. Dispatch Queue { quickSort() quickSort() } { quickSort() quickSort() }

    { quickSort() quickSort() } CPU ίΞ CPU ίΞ CPU ίΞ
  39. Dispatch Queue { quickSort() quickSort() } { quickSort() quickSort() }

    { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } CPU ίΞ CPU ίΞ CPU ίΞ
  40. Dispatch Queue { quickSort() quickSort() } { quickSort() quickSort() }

    { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } CPU ίΞ CPU ίΞ CPU ίΞ ίΞͷୣ͍߹͍
  41. Dispatch Queue { quickSort() quickSort() } { quickSort() quickSort() }

    { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } { quickSort() quickSort() } CPU ίΞ CPU ίΞ CPU ίΞ ίΞͷୣ͍߹͍ Φʔόʔϔου
  42. 8

  43. 8

  44. ݁Ռ • 1ԯݸͷϥϯμϜͳ੔਺ͷ഑ྻΛιʔτ ඪ४ϥΠϒϥϦ
 Array.sort() ௚ྻ൛ ΫΠοΫιʔτ ฒߦ൛ ΫΠοΫιʔτ ฒߦ൛

    ΫΠοΫιʔτ
 with Semaphore 10.3 seconds 9.0 seconds 8.1 seconds 4.5 seconds - 5ճଌఆͨ͠ฏۉ஋Ͱ͢ɻ - εϥΠυʹ৐ͤͨίʔυ͸આ໌༻Ͱ͢ɻ࣮ࡍʹଌఆʹར༻ͨ͠ίʔυ͸Githubʹ͋Γ·͢ɻ - MacBook Pro 15-inch, 2018, Core i9 2.9 GHz. - macOS Catalina 10.15.6, Swift 5.2.4, ࠷దԽ͋Γ ( -O )
  45. ࣌ؒ 0 sec 2 sec 4 sec 6 sec 8

    sec 10 sec 12 sec Array.sort() ௚ྻΫΠοΫιʔτ ฒߦΫΠοΫιʔτ ฒߦΫΠοΫιʔτվ ໿10ඵ ໿9ඵ ໿8ඵ ໿4.5ඵ
  46. 8

  47. Semaphoreͷॳظ஋Ͱ଎͞Λൺֱ 6ίΞ12εϨουͷMacBook ProͰܭଌ 0 2.5 5 7.5 10 12.5 15

    1 2 3 4 5 6 7 8 9 10 11 12 13 14 - 5ճଌఆͨ͠ฏۉ஋Ͱ͢ɻ - 1ԯݸͷϥϯμϜͳ੔਺Λιʔτɻ - εϥΠυʹ৐ͤͨίʔυ͸આ໌༻Ͱ͢ɻ࣮ࡍʹଌఆʹར༻ͨ͠ίʔυ͸Githubʹ͋Γ·͢ɻ - MacBook Pro 15-inch, 2018, Core i9 2.9 GHz. - macOS Catalina 10.15.6, Swift 5.2.4, ࠷దԽ͋Γ ( -O )
  48. Semaphoreͷॳظ஋Ͱ଎͞Λൺֱ 6ίΞ12εϨουͷMacBook ProͰܭଌ 0 2.5 5 7.5 10 12.5 15

    1 2 3 4 5 6 7 8 9 10 11 12 13 14 - 5ճଌఆͨ͠ฏۉ஋Ͱ͢ɻ - 1ԯݸͷϥϯμϜͳ੔਺Λιʔτɻ - εϥΠυʹ৐ͤͨίʔυ͸આ໌༻Ͱ͢ɻ࣮ࡍʹଌఆʹར༻ͨ͠ίʔυ͸Githubʹ͋Γ·͢ɻ - MacBook Pro 15-inch, 2018, Core i9 2.9 GHz. - macOS Catalina 10.15.6, Swift 5.2.4, ࠷దԽ͋Γ ( -O ) ཧ૝
  49. 0.002 ඵ 0.2 ඵ ໿100ഒ - 5ճଌఆͨ͠ฏۉ஋Ͱ͢ɻ - εϥΠυʹ৐ͤͨίʔυ͸આ໌༻Ͱ͢ɻ࣮ࡍʹଌఆʹར༻ ͨ͠ίʔυ͸Githubʹ͋Γ·͢ɻ

    - MacBook Pro 15-inch, 2018, Core i9 2.9 GHz. - macOS Catalina 10.15.6, Swift 5.2.4, ࠷దԽ͋Γ ( -O )
  50. x y ϝΠϯϝϞϦ Core 0 Core 1 sum() inc() Cache

    Cache x y ֤ίΞʹΩϟογϡ͕ උΘ͍ͬͯΔ
  51. x y ϝΠϯϝϞϦ Core 0 Core 1 sum() inc() Cache

    Cache x y ͦΕͧΕͷίΞͷ ΩϟογϡʹΞΫηε
  52. x y ϝΠϯϝϞϦ Core 0 Core 1 sum() inc() Cache

    Cache x y x y Yʹରͯ͠ॻ͖ࠐΈ
  53. x y' ϝΠϯϝϞϦ Core 0 Core 1 sum() inc() Cache

    Cache x y' x y' ͪ͜ΒͷΩϟογϡ΋ ߋ৽ͯ͠͠·͏
  54. x y ϝΠϯϝϞϦ Core 0 Core 1 sum() inc() Cache

    Cache x y' x y' Φʔόʔϔου ͪ͜ΒͷΩϟογϡ΋ ߋ৽ͯ͠͠·͏