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

並行四方山話/tales_of_concurrency

fuzyco
January 09, 2019

 並行四方山話/tales_of_concurrency

社内の新年会で話した資料です。
このプレゼンテーションは
- カーネルスレッドとグリーンスレッドの違い
- JVMのスレッド
- Actorモデル
- Goroutine
の内容を含みます。

This presentation includes these topics below:
- Difference between kernel thread and green thread
- JMV Thread
- Actor Model
- Goroutine

fuzyco

January 09, 2019
Tweet

More Decks by fuzyco

Other Decks in Technology

Transcript

  1. ฒߦ࢛ํࢁ࿩
    04ʙHPSPVUJOFʙ"DUPS
    ౻໺޺थ

    View full-size slide

  2. ·ͣ͸͡Ίʹ

    ΞηϯϒϦݴޠͱ͔$ݴޠͱ͔͸ग़͖ͯ·ͤΜ
    ฒߦॲཧػߏͷ಺෦࣮૷ΑΓ΋࢓૊ΈʹϑΥʔΧε͠·͢

    View full-size slide

  3. ࿩͢͜ͱ

    wεϨου͕̍छྨ͡Όͳ͍͜ͱ
    w֤ฒߦॲཧϞδϡʔϧͷ࢓૊Έ
    w+7.ͷεϨου
    wHPSPVUJOF
    w"LLB"DUPS
    ˞ࣗ෼͕ؾʹͳͬͨ͜ͱΛத৺ʹ࿩͍͖ͯ͠·͢
    ۀ຿ʹ௚઀໾ཱ͔ͭ͸ෆ໌͕ͩɺ
    ϚϧνίΞͷ࣌୅ͳͷͰฒߦॲཧ͔Β͸ආ͚ΒΕͳ͍

    View full-size slide

  4. ΞδΣϯμ

    0QFSBUJOH4ZTUFN
    1SPHSBNNJOH-BOHVBHF
    ௿
    ߴ

    View full-size slide

  5. ΞδΣϯμ

    0QFSBUJOH4ZTUFN
    1SPHSBNNJOH-BOHVBHF
    ௿
    ߴ

    View full-size slide

  6. 0QFSBUJOH4ZTUFN

    w ϓϩηε
    w εϨου

    View full-size slide

  7. ϓϩηε

    ϓϩάϥϜΛىಈͨ͠ͱ͖ʹͰ͖Δ
    w ΞυϨεۭؒ
    w ؔ࿈ͷ͋Δ͢΂ͯͷঢ়ଶ ϨδελͳͲ

    w ֤छͷ৘ใ ϓϩηε*%ͳͲ

    w ϓϩηεؒ௨৴ʹ࢖ΘΕΔɺͦͷଞͷϦιʔε ϝοηʔδΩϡʔͳͲ

    ϓϩηε

    View full-size slide

  8. εϨου

    $16ίΞ͕࣮ߦ͢Δॲཧͷ୯Ґ
    ελοΫ΍Ϩδελͱ͍ͬͨɺ
    ࠷খݶͷϦιʔεΛ࣋ͭ
    ɾελοΫྖҬ
    ɾελοΫϙΠϯλ
    ɾϓϩάϥϜΧ΢ϯλ

    View full-size slide

  9. ϓϩηεͱεϨου

    ˞Ϛϧνϓϩηεͷ࿩͸͠·ͤΜ
    γϯάϧεϨου ϚϧνεϨου
    ϓϩηε಺ʹ̍ͭҎ্ͷεϨου͕ଘࡏ͢Δ
    ϓϩηε಺ͷεϨου͸ಉ͡ϝϞϦΛڞ༗

    View full-size slide

  10. ϚϧνεϨουϞσϧ

    CPU
    ҰͭͷCPUίΞʹରͯ͠εϨου͕ෳ਺͋Δ৔߹ɺ
    εϨουΛ੾Γସ͑ͳ͕Βෳ਺ͷλεΫΛ࣮ߦ͢Δ͜ͱ
    εϨου1
    εϨου2
    ࣌ؒ

    View full-size slide

  11. ϚϧνεϨουϞσϧ
    ʹ͓͍ͯॏཁͳ͜ͱ

    ίϯςΩετεΠον
    εϨουͷੜ੒ίετϝϞϦ࢖༻ྔ
    εϨουͷ੾Γସ͑ʢίϯςΩετεΠονʣΛ
    ͍͔ʹ୹࣌ؒͰͰ͖Δ͔
    ҰͭͷεϨουͷϝϞϦ࢖༻ྔ͕খ͚͞Ε͹ɺ
    ͨ͘͞ΜͷεϨουΛੜ੒Ͱ͖Δ

    View full-size slide

  12. ίϯςΩετεΠον

    εϨουΛ੾Γସ͑Δ࣌͸ɺ
    ࣍ʹಈ࡞͢΂͖εϨουͷબ୒ʢεέδϡʔϦϯάʣͱ
    બ୒͞ΕͨεϨουͷ࠶։ʢσΟεύονʣ͕ߦΘΕΔ
    εϨουεέδϡʔϥʔ
    εϨου εϨου
    ϝϞϦͷίϐʔΛߦͬͨΓ͢ΔͷͰɺΦʔόʔϔου͕͔͔Δ

    View full-size slide

  13. ੜ੒ίετϝϞϦ࢖༻ྔ

    ϝϞϦ࢖༻ྔ͸ελοΫͷαΠζͳͲʹґଘ͢Δ
    ϝϞϦྖҬΛ֬อ͢ΔͷͰɺੜ੒ʹΦʔόʔϔου͕͔͔Δ

    View full-size slide

  14. ϚϧνεϨουͷ෼ྨ

    εϨουͷछྨ ࣮ߦํࣜ
    ɾϢʔβʔεϨου
    ɾΧʔωϧεϨου
    ɾ/
    ɾ
    ɾ./

    View full-size slide

  15. ૝ఆ؀ڥ

    Ϣ
    ɹ
    β
    ɹ
    Χ
    ɹ
    ω
    ϧ
    ۭ
    ؒ
    ۭ
    ؒ
    ʔ ʔ
    ʔ
    $16 $16
    ΞϓϦέʔγϣϯϓϩηε
    04
    ϋʔυ΢ΣΞ
    ҰͭͷΞϓϦέʔγϣϯϓϩηε͕ϚϧνεϨουͰಈ͘

    View full-size slide

  16. εϨουͷछྨ

    wΧʔωϧεϨου
    wϢʔβʔεϨου

    View full-size slide

  17. ΧʔωϧεϨου

    Χʔωϧεέδϡʔϥʔ
    $16 $16
    Χ
    ɹ
    ω
    ϧ
    04͕ఏڙ͢ΔεϨου
    ۭ
    ؒ
    ʔ
    04ͷΧʔωϧ಺ͷ
    εέδϡʔϥʔʹ؅ཧ͞ΕΔ

    View full-size slide

  18. ΧʔωϧεϨου

    Χʔωϧεέδϡʔϥʔ
    $16 $16
    ͭͷ$16ίΞ͸ৗʹҰͭͷ
    ΧʔωϧεϨου͔࣮͠ߦͰ͖ͳ͍
    ͭͷ$16ίΞʹෳ਺ͷΧʔωϧεϨου
    ͕͋Δ৔߹͸ɺ04͕ΧʔωϧεϨουΛ
    ੾Γସ͑ͳ͕ΒॲཧΛ࣮ߦ͢Δ

    View full-size slide

  19. ϢʔβʔεϨου

    άϦʔϯεϨουͱ΋͍͏
    Ϣ
    ɹ
    β
    ɹ
    Χ
    ɹ
    ω
    ϧ
    ۭ
    ؒ
    ۭ
    ؒ
    ʔ ʔ
    ʔ
    Ϣʔβʔεέδϡʔϥʔ
    ϥϯλΠϜʢݴޠʣ
    ͕ఏڙ͢ΔεϨου
    ΞϓϦέʔγϣϯϓϩηε
    ϥϯλΠϜͷ
    εέδϡʔϥʔʹ؅ཧ͞ΕΔ

    View full-size slide

  20. ϢʔβʔεϨου

    ͋͘·ͰॲཧΛ࣮ߦ͢Δͷ͸ΧʔωϧεϨου
    Ϣʔβʔεέδϡʔϥʔ͕ΧʔωϧεϨουʹ
    ରͯ͠ϢʔβʔεϨουΛׂΓ౰ͯΔ
    Ϣʔβʔεέδϡʔϥʔ
    ΞϓϦέʔγϣϯϓϩηε
    ͭͷΧʔωϧεϨουʹෳ਺ͷϢʔβʔεϨου
    ͕͋Δ৔߹͸ɺΞϓϦέʔγϣϯଆ͕ϢʔβʔεϨουΛ
    ੾Γସ͑ͳ͕ΒॲཧΛ࣮ߦ͢Δ

    View full-size slide

  21. ϢʔβʔεϨου

    ϢʔβʔεϨουΛ࣮૷͍ͯ͠Δݴޠ
    w3VCZ
    w)BTLFMM
    w(PMBOH ޙड़

    FUD

    View full-size slide

  22. ίϯςΩετεΠονൺֱ

    ΧʔωϧεϨου
    ϢʔβʔεϨου
    ϢʔβʔۭؒͷσʔλΛ
    Χʔωϧۭؒʹίϐʔ͢ΔͷͰɺ
    Φʔόʔϔου͕େ͖͍
    ϢʔβʔۭؒͰ׬݁͢ΔͨΊɺ
    Φʔόʔϔου͕খ͍͞
    γεςϜίʔϧ
    Χʔωϧεέδϡʔϥʔ
    Ϣʔβʔεέδϡʔϥʔ

    View full-size slide

  23. ੜ੒ίετϝϞϦ࢖༻ྔ

    ΧʔωϧεϨου
    ϢʔβʔεϨου
    ࣮ߦ؀ڥ 04
    ʹґଘ͢Δ
    ϥϯλΠϜʢϓϩάϥϛϯάݴޠʣʹґଘ͢Δ
    جຊతʹΧʔωϧεϨουΑΓ͸ੜ੒লίετͰϝϞϦ΋খ͍͞

    View full-size slide

  24. εϨουͷൺֱ

    ΧʔωϧεϨου ϢʔβʔεϨου
    ίϯςΩετεΠον ஗͍ ଎͍
    αΠζ
    04ʹґଘ͢Δ
    ʢେ͖͍

    ϥϯλΠϜʹґଘ͢Δ
    খ͍͞

    View full-size slide

  25. ࣮ߦํࣜ

    w/ํࣜʢ/ݸͷϢʔβʔεϨουɿݸͷΧʔωϧεϨουʣ
    wํࣜʢ̍ݸͷ࣮ߦεϨουɿ̍ݸͷΧʔωϧεϨουʣ
    w./ํࣜʢ.ݸͷϢʔβʔεϨουɿ/ݸͷΧʔωϧεϨουʣ
    ϚϧνεϨουػߏΛ࣮ݱ͢Δʹ͸
    ҎԼͷ͍ͣΕ͔ͷ࣮ߦํࣜΛͱΔ

    View full-size slide

  26. /ํࣜ

    Χʔωϧεέδϡʔϥʔ
    $16 $16
    Ϣ
    ɹ
    β
    ɹ
    Χ
    ɹ
    ω
    ϧ
    ۭ
    ؒ
    ۭ
    ؒ
    ʔ ʔ
    ʔ
    Ϣʔβʔεέδϡʔϥʔ
    /ݸͷϢʔβʔεϨουɿݸͷΧʔωϧεϨου
    ΞϓϦέʔγϣϯϓϩηε
    ΞϓϦέʔγϣϯϓϩηε্ͷ̍ͭҎ্ͷ
    ϢʔβʔεϨου͕ɺ
    ̍ͭͷΧʔωϧεϨουΛ࢖͏ ෳ਺͸ෆՄ

    ̍ϓϩηεʹ̍ΧʔωϧεϨουͷΈ

    View full-size slide

  27. /ํࣜ

    ϝϦοτ
    σϝϦοτ
    ҰͭͷΧʔωϧεϨου͔͠࢖͑ͳ͍ͨΊɺ
    ϚϧνίΞΛ׆͔ͤͳ͍ʢฒߦʣ
    ίϯςΩετεΠον͕଎͍
    Χʔωϧεέδϡʔϥʔ
    $16 $16
    Ϣʔβʔεέδϡʔϥʔ
    ΞϓϦέʔγϣϯϓϩηε

    View full-size slide

  28. ํࣜ

    Χʔωϧεέδϡʔϥʔ
    $16 $16
    Ϣ
    ɹ
    β
    ɹ
    Χ
    ɹ
    ω
    ϧ
    ۭ
    ؒ
    ʔ ʔ
    ʔ
    ۭ
    ؒ
    ̍ݸͷ࣮ߦεϨουɿ̍ݸͷΧʔωϧεϨου
    ΞϓϦέʔγϣϯϓϩηε͸ׂΓ౰ͯΒΕͨ
    ΧʔωϧεϨουͰॲཧΛ࣮ߦ͢Δ
    ΞϓϦέʔγϣϯϓϩηε͸ɺ
    $16ίΞͷ਺͚ͩΧʔωϧεϨουΛ
    ಉ࣌ʹ࢖͑Δʢฒߦ͔ͭฒྻ͕Մೳ

    ΞϓϦέʔγϣϯϓϩηε
    ̍ϓϩηεʹෳ਺ΧʔωϧεϨου͕Մೳ

    View full-size slide

  29. ํࣜ

    ϝϦοτ
    σϝϦοτ
    ϚϧνίΞΛ׆͔ͤΔ
    γεςϜίʔϧΛ൐͏ͨΊɺ
    ίϯςΩετεΠον͕஗͍
    Χʔωϧεέδϡʔϥʔ
    $16 $16
    ΞϓϦέʔγϣϯϓϩηε

    View full-size slide

  30. ./ํࣜ

    Χʔωϧεέδϡʔϥʔ
    $16 $16
    Ϣʔβʔεέδϡʔϥʔ
    Ϣ
    ɹ
    β
    ɹ
    Χ
    ɹ
    ω
    ϧ
    ۭ
    ؒ
    ۭ
    ؒ
    ʔ ʔ
    ʔ
    .ݸͷϢʔβʔεϨουɿ/ݸͷΧʔωϧεϨου
    ΞϓϦέʔγϣϯϓϩηε
    ͱ/ͷϋΠϒϦουܕ
    ϓϩηεʹෳ਺ΧʔωϧεϨου͕ՄೳͰɺ
    ͦΕΒΛϢʔβʔεϨουͰڞ༗ͯ͠࢖͏Πϝʔδ
    ʢฒߦ͔ͭฒྻ͕Մೳ

    View full-size slide

  31. ./ํࣜ

    ϝϦοτ
    σϝϦοτ
    ํࣜͱ/ํࣜͷྑ͍ॴͲΓ
    ϚϧνίΞΛ׆͔ͤͯɺ
    ίϯςΩετεΠον΋଎͍
    εέδϡʔϥʔ͕ෳࡶʹͳΔ
    ݴޠଆ͕ؤுΒͳ͍ͱ͍͚ͳ͍
    Χʔωϧεέδϡʔϥʔ
    $16 $16
    Ϣʔβʔεέδϡʔϥʔ
    ΞϓϦέʔγϣϯϓϩηε

    View full-size slide

  32. ࣮ߦํࣜͷൺֱ

    / ./
    ϝϦοτ
    ίϯςΩετ
    εΠον͕଎͍
    Ϛγϯ্ͷίΞ
    Λશͯ࢖͑Δ
    ྑ͍ͱ͜ΖͲΓ
    σϝϦοτ
    ϚϧνίΞΛ
    ੜ͔ͤͳ͍
    ίϯςΩετ
    εΠον͕஗͍
    εέδϡʔϥʔ
    ͕ෳࡶʹͳΔ

    View full-size slide

  33. εϨου·ͱΊ

    ϓϩάϥϛϯάݴޠ͕࡞ΔεϨουͳͷ͔
    04͕࡞ΔεϨουͳͷ͔
    εϨου͕ͲͷΑ͏ʹεέδϡʔϦϯά͞ΕΔͷ͔
    ීஈҙࣝͤͣʹϓϩάϥϜΛॻ͍͍ͯΔ͕ɺ
    ֤ϓϩάϥϛϯάݴޠ͸ฒߦॲཧͷੑೳΛ্͛ΔͨΊʹɺ
    ্هͷ͜ͱΛ޻෉͍ͯ͠Δ

    View full-size slide

  34. ΞδΣϯμ

    0QFSBUJOH4ZTUFN
    1SPHSBNNJOH-BOHVBHF
    ௿
    ߴ

    View full-size slide

  35. w ֤ฒߦॲཧϞδϡʔϧͷڍಈ
    w ΧʔωϧεϨου͔ϢʔβʔεϨου͔
    w εέδϡʔϦϯά
    1SPHSBNNJOH-BOHVBHF

    ˞۩ମతͳੑೳͱ͔҆શੑͱ͔ʹ͸৮Ε·ͤΜ

    View full-size slide

  36. w +7.ͷεϨου
    w HPSPVUJOF
    w "LLB"DUPS
    1SPHSBNNJOH-BOHVBHF

    ͜ΕΒͷ࣮ଶΛ௥͍ͬͯ͘

    View full-size slide

  37. w +7.ͷεϨου
    w HPSPVUJOF
    w "LLB"DUPS
    1SPHSBNNJOH-BOHVBHF

    View full-size slide

  38. +7.ͷεϨου

    val thread = new Thread()
    <ࢀߟ>KELIPUTQPUTSDPTMJOVYWNPT@MJOVYDQQ
    ಺෦Ͱ͸ΧʔωϧεϨουΛੜ੒͍ͯ͠Δ
    Χʔωϧۭؒ
    JOUSFUQUISFBE@DSFBUF UJE BUUS WPJE
    WPJE

    UISFBE@OBUJWF@FOUSZ
    UISFBE

    val executorService = Executors.newFixedThreadPool(4)
    ͭͷΧʔωϧ
    εϨουͷϓʔϧΛੜ੒

    View full-size slide

  39. +7.ͷεϨου

    +7.ͷεϨου͸ΧʔωϧεϨου
    ʢ+BWB·Ͱ͸ϢʔβʔεϨου͕͋ͬͨΒ͍͠ʣ
    ΧʔωϧεϨουͷελοΫαΠζ͸
    ݻఆ௕Ͱ͋Γɺ04ʹґଘ͢Δ

    View full-size slide

  40. +7.εϨουͷ
    εέδϡʔϦϯά

    ϢʔβʔεϨου͕ଘࡏ͠ͳ͍ͷͰɺํࣜ
    Χʔωϧεέδϡʔϥʔ
    $16 $16
    $16ͷίΞ਺ΑΓ΋εϨου͕ଟ͍৔߹͸ɺ
    Χʔωϧεέδϡʔϥʔ͕
    εϨουΛ੾Γସ͑Δ
    +7.ϓϩηε

    View full-size slide

  41. +7.ͷεϨου·ͱΊ

    +7.ͷ
    εϨου
    HPSPVUJOF "LLB"DUPS
    ࣮ଶ
    Χʔωϧ
    εϨου
    αΠζ .#
    ࣮ߦํࣜ

    View full-size slide

  42. w +7.ͷεϨου
    w HPSPVUJOF
    w "LLB"DUPS
    1SPHSBNNJOH-BOHVBHF

    View full-size slide

  43. HPSPVUJOFͱ͸

    go func() {
    fmt.Println("run asynchronously.")
    }()
    HPGVOD
    Ͱؔ਺ΛඇಉظͰ࣮ߦ͢Δ
    ඇಉظॲཧΛ؆୯ʹͰ͖Δੌ͍Ϡπ

    View full-size slide

  44. HPSPVUJOFͷ࣮ଶ

    ΧʔωϧεϨουͰ͸ͳ͘ɺϢʔβʔεϨου
    HPMBOHଆ͕ੜ੒͔Βഁغ·ͰΛ؅ཧ͢Δ
    ˞ݫີʹ͸ϢʔβʔεϨουͰ͸ͳ͍Β͍͠
    HPSPVUJOFεέδϡʔϥʔ
    HPΞϓϦέʔγϣϯ

    View full-size slide

  45. HPSPVUJOFͷαΠζ

    HPSPVUJOFͷελοΫαΠζ͸อଘ͢Δσʔλʹ
    Ԡͯ͡ಈతʹ৳ॖ͢Δ
    ৽͘͠ੜ੒ͨ͠HPSPVUJOF͸,#ͷελοΫαΠζ
    +7.ͷεϨουͷͷελοΫαΠζ

    View full-size slide

  46. HPSPVUJOFͷεέδϡʔϦϯά

    εέδϡʔϦϯά͸./ํࣜ
    ෳ਺ͷHPSPVUJOF͕
    ҰͭͷΧʔωϧεϨουΛ
    ͍࣋ͬͯΔΠϝʔδ
    Χʔωϧεέδϡʔϥʔ
    $16 $16
    HPSPVUJOFεέδϡʔϥʔ
    ΧʔωϧεϨουΛҙࣝͤͣʹ
    HPଆͰHPSPVUJOFΛߴ଎ʹ੾Γସ͑ͯ
    ฒߦॲཧͷੑೳΛ্͍͛ͯΔ
    HPΞϓϦέʔγϣϯ
    ෳࡶͳεέδϡʔϦϯά͸
    HPଆͰٵऩ͍ͯ͠Δ

    View full-size slide

  47. HPSPVUJOFͷ
    ίϯςΩετεΠον࣌ؒ

    ίϯςΩετεΠονʹཁ͢Δ࣌ؒͷൺֱྫ
    Χʔωϧ
    εϨου
    HPSPVUJOF
    ࣌ؒ<ЖT>
    <Ҿ༻>(PݴޠʹΑΔฒߦॲཧ
    ίϯςΩετεΠονΛΧʔωϧεϨουΑΓ΋ਝ଎ʹߦ͑Δ

    View full-size slide

  48. HPSPVUJOF·ͱΊ

    +7.ͷ
    εϨου
    HPSPVUJOF "LLB"DUPS
    ࣮ଶ
    Χʔωϧ
    εϨου
    Ϣʔβʔ
    εϨου
    αΠζ .# ,#
    ࣮ߦํࣜ ./

    View full-size slide

  49. w +7.ͷεϨου
    w HPSPVUJOF
    w "LLB"DUPS
    1SPHSBNNJOH-BOHVBHF

    View full-size slide

  50. "LLB"DUPS

    • ScalaͱJavaͷApache2ϥΠηϯεͰఏڙ͞Ε͍ͯΔOSS
    ϥΠϒϥϦ
    • ΞΫλʔϞσϧΛద༻ͨ͠ϥΠϒϥϦ

    View full-size slide

  51. ΞΫλʔϞσϧ

    wશͯͷ΋ͷ͸ΞΫλʔ
    wඇಉظϝοηʔδύογϯά
    w୯ҰΞΫλʔ಺Ͱͷϝοηʔδॲཧͷஞ࣍ੑ

    View full-size slide

  52. ΞΫλʔϞσϧΛ࣮૷ͨ͠ݴޠ

    w+BWB4DBMB
    w&SMBOH

    View full-size slide

  53. "LLB"DUPS

    ͦΕͧΕͷΞΫλʔ͸ϝʔϧϘοΫεΛ࣋ͪɺ
    ϝοηʔδΛૹΓ͋ͬͯॲཧΛߦ͏
    ϝοηʔδͷ΍ΓͱΓ͸શͯඇಉظ
    ΞΫλʔ̍ ΞΫλʔ̎
    ΞΫλʔ̏ ΞΫλʔ̐

    View full-size slide

  54. "LLB"DUPS

    Dispatcher͕
    ΞΫλʔʹεϨουΛ
    ׂΓ౰ͯΔ
    ΞΫλʔ
    DispatcherʹׂΓ౰ͯΒΕͨ
    εϨουΛ࢖ͬͯॲཧΛ࣮ߦ
    ΞΫλʔ
    ΞΫλʔ ΞΫλʔ

    View full-size slide

  55. "LLB"DUPS

    Dispatcher͕
    ΞΫλʔʹεϨουΛ
    ׂΓ౰ͯΔ
    ΞΫλʔ
    DispatcherʹׂΓ౰ͯΒΕͨ
    εϨουΛ࢖ͬͯॲཧΛ࣮ߦ
    ΞΫλʔ
    ΞΫλʔ ΞΫλʔ
    wΞΫλʔͷ࣮ଶ
    w%JTQBUDIFSׂ͕Γ౰ͯΔεϨου

    View full-size slide

  56. ΞΫλʔʹ·ͭΘΔΑ͘ฉ͘࿩

    ΞΫλʔ͸ܰྔϓϩηεͩΑ
    εϨουͷ͜ͱΛܰྔϓϩηεͱ΋ݴͬͨΓ͢Δ͕ɺ
    ͜ͷจ຺Ͱ͸εϨουͰ͸ͳ͍
    ΍΍͍͜͠

    View full-size slide

  57. ܰྔϓϩηε
    ʢ-JHIU8FJHIU1SPDFTTʣ

    Χʔωϧ͕؅ཧ͢ΔɺεϨουΛ࣮ߦ͢ΔΦϒδΣΫτ
    -81͕ϢʔβʔεϨουΛબ୒ͯ͠ॲཧΛ࣮ߦ͢Δ
    ϢʔβʔۭؒͷεϨουͱΧʔωϧۭؒͷ-81͕Ϛοϐϯά
    Λ੾Γସ͑ͳ͕ΒॲཧΛ࣮ߦ͢Δ
    <Ҿ༻>IUUQTKBXJLJQFEJBPSHXJLJ
    &#&"$&&@ &#&#&&
    "&#$&#'

    View full-size slide

  58. ܰྔϓϩηε
    ʢ-JHIU8FJHIU1SPDFTTʣ

    Χʔωϧ͕؅ཧ͢ΔɺεϨουΛ࣮ߦ͢ΔΦϒδΣΫτ
    -81͕ϢʔβʔεϨουΛબ୒ͯ͠ॲཧΛ࣮ߦ͢Δ
    ϢʔβʔۭؒͷεϨουͱΧʔωϧۭؒͷ-81͕Ϛοϐϯά
    Λ੾Γସ͑ͳ͕ΒॲཧΛ࣮ߦ͢Δ
    ͜Ε΋ΞΫλʔͱ͸
    ҟͳΔ࿩
    <Ҿ༻>IUUQTKBXJLJQFEJBPSHXJLJ
    &#&"$&&@ &#&#&&
    "&#$&#'

    View full-size slide

  59. &SMBOHͷܰྔϓϩηε

    &SMBOHͷΞΫλʔͷਖ਼ମ͸QSPDFTTͱ͍͏DͰॻ͔Εͨߏ଄ମ
    04ͷϓϩηεͱ͸ҟͳΔ
    άϦʔϯϓϩηεͱݴΘΕͨΓ΋͢Δ

    TUSVDUQSPDFTT\
    ɾώʔϓྖҬ
    ɾελοΫ
    ɾϨδελ
    ɾΠϯετϥΫγϣϯɾϙΠϯλ
    ɾϝοηʔδɾΩϡʔ
    ɾ਌ϓϩηεͷ*%
    ^
    Ҿ༻JOUFSOBMMZ>
    αΠζ͸,#

    View full-size slide

  60. "LLB"DUPS

    "LLB"DUPSʹ͓͍ͯ͸ΞΫλʔ͸4DBMBͷΦϒδΣΫτ
    +7.ϓϩηε
    αΠζ͸,#
    ΞΫλʔΦϒδΣΫτ

    View full-size slide

  61. "LLB"DUPS

    +7.ϓϩηε
    ΧʔωϧεϨου͕͜ͷΞΫλʔΦϒδΣΫτʹ
    ׂΓ౰ͯΒΕͯॲཧ͕࣮ߦ͞ΕΔ
    ͨͩͷΦϒδΣΫτͳͷͰɺΧʔωϧεϨουͱ
    ҧ͍ੜ੒ʹίετ͕͔͔Βͳ͍

    View full-size slide

  62. %JTQBUDIFS

    ΞΫλʔʹΧʔωϧεϨουΛׂΓ౰ͯΔ
    σϑΥϧτ͸$16ͷίΞ਺෼ͷΧʔωϧεϨουϓʔϧΛѻ͏
    abstract class ActorSystem extends ActorRefFactory {
    implicit def dispatcher: ExecutionContextExecutor
    }
    Χʔωϧۭؒ

    View full-size slide

  63. "LLB"DUPSʹ͓͚Δ
    εέδϡʔϦϯά

    Χʔωϧεέδϡʔϥʔ
    +7.ϓϩηε
    $16 $16
    %JTQBUDIFS
    ํ͕ࣜͩɺ+7.ϓϩηεͰ͸ͳ͘ɺ
    ΞΫλʔ ܰྔϓϩηε
    ͕
    ΧʔωϧεϨουΛ࢖ͬͯॲཧΛߦ͏
    %JTQBUDIFS͕
    ϢʔβʔεέδϡʔϥʔͷΑ͏ʹৼΔ෣͏
    Πϝʔδ

    View full-size slide

  64. ·ͱΊ

    +7.ͷ
    εϨου
    HPSPVUJOF "LLB"DUPS
    ࣮ଶ
    Χʔωϧ
    εϨου
    Ϣʔβʔ
    εϨου
    ܰྔϓϩηε
    ΦϒδΣΫτ

    αΠζ .# ,# ,#
    ࣮ߦํࣜ ./

    View full-size slide

  65. ·ͱΊ

    ࣮ߦํࣜ΋େࣄ͚ͩͲɺίϯςΩετεΠονͷ
    λΠϛϯάͳͲ΋ੑೳʹӨڹ͢Δ
    ੑೳ΋େࣄ͚ͩͲɺεϨουηʔϑ͔ͳͲͷ҆શੑ΋େࣄ
    ֤ݴޠ΋ੑೳΛ্͛ΔͨΊʹɺ
    ৭ʑͳฒߦॲཧػػߏΛͱ͍ͬͯΔ
    ฒߦॲཧΛͲ͏ઃܭ͢Δ͔͸ϓϩάϥϚ࣍ୈ

    View full-size slide