Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
『Go言語による並行処理』 を読んで
Search
abemotion
February 07, 2020
Technology
1
1.1k
『Go言語による並行処理』 を読んで
golang.tokyo # 29 の資料です。
https://golangtokyo.connpass.com/event/164955/
abemotion
February 07, 2020
Tweet
Share
More Decks by abemotion
See All by abemotion
Go Modules
abemotion
2
790
gRPC Server with golang
abemotion
3
1.5k
Other Decks in Technology
See All in Technology
Making your applications cross-environment - OSCG 2024 NA
salaboy
0
200
Platform Engineering for Software Developers and Architects
syntasso
1
520
20241120_JAWS_東京_ランチタイムLT#17_AWS認定全冠の先へ
tsumita
2
300
AGIについてChatGPTに聞いてみた
blueb
0
130
iOSチームとAndroidチームでブランチ運用が違ったので整理してます
sansantech
PRO
0
150
DynamoDB でスロットリングが発生したとき/when_throttling_occurs_in_dynamodb_short
emiki
0
260
Introduction to Works of ML Engineer in LY Corporation
lycorp_recruit_jp
0
140
個人でもIAM Identity Centerを使おう!(アクセス管理編)
ryder472
4
240
TypeScriptの次なる大進化なるか!? 条件型を返り値とする関数の型推論
uhyo
2
1.7k
Why App Signing Matters for Your Android Apps - Android Bangkok Conference 2024
akexorcist
0
130
DynamoDB でスロットリングが発生したとき_大盛りver/when_throttling_occurs_in_dynamodb_long
emiki
1
440
SREが投資するAIOps ~ペアーズにおけるLLM for Developerへの取り組み~
takumiogawa
2
460
Featured
See All Featured
BBQ
matthewcrist
85
9.3k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Facilitating Awesome Meetings
lara
50
6.1k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
The Pragmatic Product Professional
lauravandoore
31
6.3k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Six Lessons from altMBA
skipperchong
27
3.5k
Designing for humans not robots
tammielis
250
25k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Transcript
HPMBOHUPLZP ʰ(PݴޠʹΑΔฒߦॲཧʱ ΛಡΜͰ HPMBOHUPLZP !BCFNPUJPO
HPMBOHUPLZP ࣗݾհ !BCFNPUJPO DPDPOBMB 4FSWFS4JEF&OHJOFFS 43&νʔϜ (P3BJMT$BLF1)1 5XJUUFSBCFNPUJPO ςχεొࢁ
HPMBOHUPLZP εΩϧͷϑϦʔϚʔέοτ ݸਓͷࣝɾεΩϧɾܦݧΛؾܰʹചങ ొձһສਓ ίίφϥ๏૬ஊ ίίφϥϛʔπ
HPMBOHUPLZP ৽ϓϩϑΟʔϧϖʔδ ˠɹϚΠΫϩαʔϏεߏͰ։ൃ ɹɹ(PΞοϓσʔτ ɹɹɹɹɹʢEFQˠ(P.PEVMFTʣ ɹɹ(PΞοϓσʔτ
HPMBOHUPLZP γεςϜߏ "1*(BUFXBZ (P ɾ1SPpMF4FSWJDF 3BJMT ͷ ઃܭʙ։ൃ·Ͱ୲ /VYU&YQSFTT (P
3BJMT H31$ H31$ "1*(BUFXBZ 1SPpMF4FSWJDF 1SPpMF8FC
HPMBOHUPLZP γεςϜߏ /VYU&YQSFTT (P H31$ H31$ "1*(BUFXBZ 3BJMT "1*4FSWJDF 1SPpMF8FC
3BJMT 1SPpMF4FSWJDF 3&45 ˠฒߦॲཧΛ͍͍ͨཁ͕݅ग़͖ͯͨ
HPMBOHUPLZP ηογϣϯ༰ ฒߦॲཧಋೖʹ͋ͨͬͯɺʰ(PݴޠʹΑΔฒߦॲཧʱΛ ಡΜͰɺ༰ʹ͍ͭͯҰ෦·ͱΊͯΈ·ͨ͠ʂ ʰ(PݴޠʹΑΔฒߦॲཧʱ *4#/
HPMBOHUPLZP ΞδΣϯμ ͳͥฒߦॲཧ͕͍͠ͷ͔ (PͰͷฒߦॲཧύλʔϯ
HPMBOHUPLZP ͳͥฒߦॲཧ͕͍͠ͷ͔
HPMBOHUPLZP ͳͥฒߦॲཧ͕͍͠ͷ͔ ڝ߹ঢ়ଶ ΞτϛοΫੑ ϝϞϦΞΫηεಉظ σουϩοΫ Ϧιʔεރׇ ฒߦॲཧͷ҆શੑΛݟۃΊΔ
HPMBOHUPLZP ڝ߹ঢ়ଶ ͭҎ্ͷૢ࡞͕ਖ਼͍͠ॱ൪Ͱ࣮ߦ͞Εͳ͚Ε͍͚ͳ͍ͱ͜ΖͰɺ ϓϩάϥϜ͕ॱংΛอূ͢ΔΑ͏ʹॻ͔Ε͍ͯͳ͔ͬͨͱ͖ʹൃੜɻ ڝ߹ঢ়ଶ͍ΘΏΔσʔλڝ߹ɻ ͋Δฒߦॲཧͷૢ࡞͕มΛಡΈࠐ͏ͱ͍ͯ͠Δͱ͖ʹɺ ΄͔ͷฒߦॲཧͷૢ࡞͕ෆ֬ఆͷλΠϛϯάͰಉ͡มʹॻ͖ࠐΈ Λߦ͓͏ͱ͢Δͱى͖Δɻ
HPMBOHUPLZP ڝ߹ঢ়ଶ ൃੜ͢ΔݪҼ ଟ͘ͷ߹ɺσʔλڝ߹ϓϩάϥϜΛྻʹߟ͑ͨͱ͖ʹࠞೖɻ ͋Δίʔυ͕ଞͷίʔυΑΓલʹॻ͍ͯ͋Δ͔ΒɺͦΕ͕ઌʹ ࣮ߦ͞ΕΔͱࢥͬͯ͠·͏ɻ ฒߦॲཧͷίʔυΛॻ͘ͱ͖ɺߟ͑ΒΕΔγφϦΦΛ৻ॏʹ ᢸ͠ͳ͍ͱ͍͚ͳ͍ɻ ֤ૢ࡞͕͔͔࣌ؒͬͯߦΘΕΔͷΛ૾͢Δͱ͔Γ͍͢ɻ
HPMBOHUPLZP ͳͥฒߦॲཧ͕͍͠ͷ͔ ڝ߹ঢ়ଶ ΞτϛοΫੑ ϝϞϦΞΫηεಉظ σουϩοΫ Ϧιʔεރׇ ฒߦॲཧͷ҆શੑΛݟۃΊΔ
HPMBOHUPLZP ΞτϛοΫੑ Կ͔͕ΞτϛοΫੑ͕͋Δͱߟ͑ΒΕΔ߹ɺ ͦΕ͕ૢ࡞͞Ε͍ͯΔಛఆͷίϯςΩετͷதͰׂෆೳɺ ͋Δ͍தஅෆՄͰ͋Δ͜ͱΛҙຯ͢Δɻ ͋Δͷ͕ΞτϛοΫͰ͋ΕɺͦΕΛෳͷฒߦͳίϯςΩετ Ͱ҆શʹѻ͑Δ͜ͱ͕҉ʹอূ͞Ε͍ͯΔɻ ͜ͷੑ࣭ʹΑͬͯཧతʹਖ਼͍͠ϓϩάϥϜΛߏͰ͖ΔΑ͏ʹͳ Δɻ
HPMBOHUPLZP ͳͥฒߦॲཧ͕͍͠ͷ͔ ڝ߹ঢ়ଶ ΞτϛοΫੑ ϝϞϦΞΫηεಉظ σουϩοΫ Ϧιʔεރׇ ฒߦॲཧͷ҆શੑΛݟۃΊΔ
HPMBOHUPLZP ϝϞϦΞΫηεಉظ ϓϩάϥϜͰڞ༗Ϧιʔεʹର͢ΔഉଞతͳΞΫηεॴ ˠΫϦςΟΧϧηΫγϣϯͱݺΕ͍ͯΔ ΫϦςΟΧϧηΫγϣϯΛकΔํ๏ͷ͕ͭϝϞϦΞΫηεಉظ
HPMBOHUPLZP ϝϞϦΞΫηεಉظ
HPMBOHUPLZP ͳͥฒߦॲཧ͕͍͠ͷ͔ ڝ߹ঢ়ଶ ΞτϛοΫੑ ϝϞϦΞΫηεಉظ σουϩοΫ Ϧιʔεރׇ ฒߦॲཧͷ҆શੑΛݟۃΊΔ
HPMBOHUPLZP σουϩοΫ ͯ͢ͷฒߦͳϓϩηε͕͓ޓ͍ͷॲཧΛͪ߹͍ͬͯΔঢ়گɻ ˠϓϩάϥϜ֎෦͔Βͷհೖ͕ͳ͍ݶΓɺܾͯ͠ಈ࡞͢Δঢ়ଶʹͳΒͳ͍ ྫ HPQSJOU4VN B C HPQSJOU4VN
C B ࠷ॳͷؔݺͼग़͠ͰɺBΛϩοΫͯ͠ɺͦͷޙCΛϩοΫ͢Δͱ͢Δɻ ͔͠͠ҰํͰɺճͷؔݺͼग़͠ͰɺCΛϩοΫͯ͠ɺͦͷޙʹBΛϩο Ϋ͠Α͏ͱ͢Δ ˠ྆ํͷΰϧʔνϯ͓ޓ͍ʹແݶʹͪ߹͏
HPMBOHUPLZP DPGGNBO݅ σουϩοΫ͕ൃੜ͢ΔͨΊʹଘࡏ͠ͳ͚Ε͍͚ͳ͍݅ ૬ޓഉଞ ͋Δฒߦϓϩηε͕Ϧιʔεʹରͯ͠ഉଞతͳݖརΛͲͷ࣌ʹ͓͍ͯอ͍࣋ͯ͠Δ ݅ͪ ͋ΔฒߦϓϩηεϦιʔεͷอ࣋ͱՃͷϦιʔεͪΛಉ࣌ʹߦΘͳ͚ΕͳΒͳ͍ ԣऔΓෆՄ ͋ΔฒߦϓϩηεʹΑͬͯอ࣋͞Ε͍ͯΔϦιʔεɺͦͷϓϩηεʹΑͬͯͷΈղ์͞ΕΔ ॥ͪ
͋Δฒߦϓϩηε 1@ ɺଞͷ࿈ͳ͍ͬͯΔ͋Δฒߦϓϩηε 1@ Λͨͳ͚ΕͳΒͳ͍ɻ ͦͯ͠ 1@ 1@ Λ͍ͬͯΔɻ ˠ͜ΕΒͷ๏ଇσουϩοΫͷ༧ʹཱͭɻͲΕ͔ͭͰਅʹͳΒͳ͚Εྑ͍
HPMBOHUPLZP ͳͥฒߦॲཧ͕͍͠ͷ͔ ڝ߹ঢ়ଶ ΞτϛοΫੑ ϝϞϦΞΫηεಉظ σουϩοΫ Ϧιʔεރׇ ฒߦॲཧͷ҆શੑΛݟۃΊΔ
HPMBOHUPLZP Ϧιʔεރׇ ฒߦϓϩηε͕ࣄΛ͢ΔͷʹඞཁͳϦιʔεΛऔಘͰ͖ͳ͍ঢ়گɻ Ϧιʔεރׇ௨ৗɺͭҎ্ͷᩦཉͳฒߦϓϩηε͕ෆެฏʹଞͷϓ ϩηε͕ՄೳͳݶΓࣄΛޮతʹߦ͓͏ͱ͍ͯ͠ΔͷΛ͍͛ͯΔɺ ͘͠·͍ͬͨͤͯ͘͞ͳ͍ͱ͍ͬͨঢ়گΛ҉ʹҙຯ͍ͯ͠Δɻ ϦιʔεރׇΛݟ͚ͭΔٕज़ɺܭଌɻ ݕͯ͠ղܾ͢Δྑ͍ํ๏ͷͭ݁ՌΛϩάग़ྗͯ͠ɺ͕ظ௨ Γʹͳ͍ͬͯΔ͔Λଌఆ͢Δ͜ͱɻ ϦιʔεރׇϓϩάϥϜ͕ඇޮతෆదʹৼͬͯ͠·͏ݪҼͱ
ͳΔɻ
HPMBOHUPLZP ͳͥฒߦॲཧ͕͍͠ͷ͔ ڝ߹ঢ়ଶ ΞτϛοΫੑ ϝϞϦΞΫηεಉظ σουϩοΫ Ϧιʔεރׇ ฒߦॲཧͷ҆શੑΛݟۃΊΔ
HPMBOHUPLZP ฒߦॲཧͷ҆શੑΛݟۃΊΔ ฒߦॲཧؾΛ͚ͭͳ͍ͱ͍͚ͳ͍؍ଟ͍͘͠ɻ ίʔυͷಡΈखʹෳࡶ͞ΛͨΒͯ͠͠·͏ͷͰɺίϝϯτΛ ॻ͘ϙΠϯτ ɾ୭͕ฒߦॲཧΛߦͳ͍ͬͯΔ͔ ɾΛղܾ͢Δʹ͋ͨΓߟ͠ͳ͚Ε͍͚ͳ͍ൣғ͕ͲͷΑ ͏ʹฒߦॲཧʹରԠ͍ͯ͠Δ͔ ɾ୭͕ಉظॲཧΛ୲͍ͬͯΔ͔ ˠಉ྅কདྷͷࣗΛॿ͚ͯ͋͛·͠ΐ͏ɻ
HPMBOHUPLZP ΞδΣϯμ ͳͥฒߦॲཧ͕͍͠ͷ͔ (PͰͷฒߦॲཧύλʔϯ
HPMBOHUPLZP (PͰͷฒߦॲཧύλʔϯ
HPMBOHUPLZP (PͰͷฒߦॲཧύλʔϯ ߆ଋ GPSTFMFDUϧʔϓ ΰϧʔνϯϦʔΫΛආ͚Δ ύΠϓϥΠϯ ϑΝϯΞτɺϑΝϯΠϯ
HPMBOHUPLZP ߆ଋ ΞυϗοΫ߆ଋ ߆ଋΛننଇ ίϛϡχςΟɺ৬ɺίʔυϕʔεʹΑͬͯࢦఆ ˠकΓଓ͚Δͷ͍͠ ଟ͘ͷਓ͕खΛೖΕΔೲظͷഭͬͨ։ൃɺؒҧͬͨίʔυ͕ࠞೖ͠ɺ ͕ى͖Δɻ ϨΩγΧϧ߆ଋ
ίϯύΠϥΛۦͯ͠߆ଋΛڲਖ਼ɻ ϨΩγΧϧείʔϓΛͬͯదͳσʔλͱฒߦॲཧͷϓϦϛςΟϒ͚ͩ Λෳͷϓϩηε͕͑ΔΑ͏ʹެ։͢Δ͜ͱΛࢦ͢ɻ ˠ͜ΕʹΑͬͯޡͬͨॲཧΛॻ͍ͯ͠·͏͜ͱΛෆՄೳʹɻ
HPMBOHUPLZP ϨΩγΧϧ߆ଋ
HPMBOHUPLZP (PͰͷฒߦॲཧύλʔϯ ߆ଋ GPSTFMFDUϧʔϓ ΰϧʔνϯϦʔΫΛආ͚Δ ύΠϓϥΠϯ ϑΝϯΞτɺϑΝϯΠϯ
HPMBOHUPLZP GPSTFMFDUϧʔϓ νϟωϧ͔Β܁Γฦ͠ͷมΛૹग़͢Δ ܁Γฦ͕͠ՄೳͳͷΛνϟωϧ্ͷม ʹมɻ ఀࢭγάφϧΛͭແݶϧʔϓ ֎෦͔Βఀࢭͷ໋ྩ͕དྷΔ·Ͱແݶʹ܁Γ ฦ͢ΰϧʔνϯΛ࡞Δɻ EPOFνϟωϧ͕ด͡ΒΕ͍ͯͳ͚Εɺ TFMFDUจΛൈ͚ͯGPSϧʔϓຊମͷΓͷॲཧΛ
ଓ͚Δɻ
HPMBOHUPLZP (PͰͷฒߦॲཧύλʔϯ ߆ଋ GPSTFMFDUϧʔϓ ΰϧʔνϯϦʔΫΛආ͚Δ ύΠϓϥΠϯ ϑΝϯΞτɺϑΝϯΠϯ
HPMBOHUPLZP ΰϧʔνϯϦʔΫΛආ͚Δ ΰϧʔνϯͷੜίετ͕খ͍͕͞ɺੜ͖͍ͯΔݶΓ($͞Εͣͬ ͯ͠·͏ɻ ˠ࣮֬ʹॲཧ͍ͯ͘͜͠ͱ͕ඞཁ ΰϧʔνϯ͕ऴྃʹࢸΔ·ͰͷྲྀΕ ΰϧʔνϯ͕ॲཧΛྃ͢Δ߹ ճ෮Ͱ͖ͳ͍ΤϥʔʹΑΓॲཧΛଓ͚ΒΕͳ͍߹ ఀࢭ͢ΔΑ͏ʹ໋ྩ͞Εͨ߹ ࠷ॳͷͭͷྲྀΕجຊతʹ࣮ߦ͞ΕΔɻ
ͭΊͷΩϟϯηϧॲཧʹؔͯ͠ɺͷΰϧʔνϯ͕ਖ਼͘͠ճऩ͢Δɻ
HPMBOHUPLZP ΰϧʔνϯϦʔΫΛආ͚Δ
HPMBOHUPLZP (PͰͷฒߦॲཧύλʔϯ ߆ଋ GPSTFMFDUϧʔϓ ΰϧʔνϯϦʔΫΛආ͚Δ ύΠϓϥΠϯ ϑΝϯΞτɺϑΝϯΠϯ
HPMBOHUPLZP ύΠϓϥΠϯ γεςϜͷநԽʹ͑Δಓ۩ͷͭɻ σʔλΛड͚औͬͯɺԿΒ͔ͷॲཧΛߦͳͬͯɺͲ͔͜ʹ͢Ұ࿈ͷ࡞ ۀ ˠ͜ΕΒͷૢ࡞ΛεςʔδͱݺͿ ύΠϓϥΠϯΛ͏͜ͱͰɺ֤εςʔδͰͷݒ೦ࣄ߲ΛΓ͚ΒΕɺ ͜Εଟ͘ͷརΛͨΒ͢ɻ ֤εςʔδΛಠཱͯ͠मਖ਼͢Δ͜ͱ͕Ͱ͖ɺεςʔδಉ࢜ͷΈ߹Θͤ ํΛεςʔδͷमਖ਼ͱಠཱͯ͠มߋ͕Մೳɻ
֤εςʔδͰͷॲཧΛ্ྲྀԼྲྀͷεςʔδͱฒߦʹߦ͑Δɻ
HPMBOHUPLZP ύΠϓϥΠϯ
HPMBOHUPLZP ύΠϓϥΠϯ ύΠϓϥΠϯεςʔδͷੑ࣭ εςʔδड͚औΔͷͱฦ͢ͷ͕ಉ͡ܕͰ͋Δ εςʔδҾ͖ճͤΔΑ͏ʹ۩ମԽ͞Εͯͳ͚ΕͳΒͳ͍ ˠੑ࣭Λຬ͍ͨͯͨ͠ͷͰɺΈ߹ΘͤΔ͜ͱ͕Ͱ͖ͨɻ
HPMBOHUPLZP ύΠϓϥΠϯ
HPMBOHUPLZP (PͰͷฒߦॲཧύλʔϯ ߆ଋ GPSTFMFDUϧʔϓ ΰϧʔνϯϦʔΫΛආ͚Δ ύΠϓϥΠϯ ϑΝϯΞτϑΝϯΠϯ
HPMBOHUPLZP ϑΝϯΞτ ύΠϓϥΠϯͷ͋ΔεςʔδͰಛʹܭࢉྔ͕େ͖͘ͳͬͨ߹ ্ྲྀͷεςʔδɺͦͷܭࢉྔ͕େ͖͍εςʔδͷॲཧ͕ऴΘΔ ͷΛػͯ͠ϒϩοΫ͞Εͯ͠·͏ɻ ˠෳͷΰϧʔνϯΛ্ͬͯྲྀͷεςʔδ͔ΒͷೖྗΛฒྻʹ ΛҾͬுͬͯ͘ΔͨΊʹɺෳͷΰϧʔνϯΛىಈ͢Δϓϩη ε
HPMBOHUPLZP ϑΝϯΞτ εςʔδ͕࣍ͷ݅ͷ྆ํʹ߹க͢Δ߹ʹϑΝϯΞτͷར ༻Λݕ౼ͯ͠ΈΔ ͦͷεςʔδ͕ΑΓલͷܭࢉ݁Ռʹґଘ͍ͯ͠ͳ͍ ࣮ߦ͕࣌ؒʹٴͿ ಛʹॱෆಉੜॏཁɻ ˠͲͷεςʔδ͕ฒߦॲཧʹͳ͍ͬͯΔ͔ɺεςʔδ͕Ͳͷॱ൪ Ͱ࣮ߦ͞ΕΔ͔ɺͲͷॱ൪Ͱ͕ฦ͞ΕΔ͔ʹอূ͕ͳ͍ͨΊ ϑΝϯΞτͤ͞Δखॱɺ֘εςʔδΛෳىಈ͢Δ͚ͩ
HPMBOHUPLZP ϑΝϯΠϯ ෳͷσʔλͷετϦʔϜΛɺ୯ҰͷετϦʔϜʹ౷߹
HPMBOHUPLZP ϑΝϯΞτϑΝϯΠϯ
HPMBOHUPLZP ·ͱΊ ฒߦॲཧʹ͓͍ͯؾΛ͚ͭͳ͍ͱ͍͚ͳ͍؍͕ཧ͞Εͨ DIBOOFMॲཧ͕ͪ͋ΔͨΊɺଞΰϧʔνϯͷ੍ޚॲཧͷฒ ྻԽʹ͑Δ ݱࡏDPOUFYU͕͋ΔͷͰɺEPOFDIBOͱҧ͏ϝϦοτཧ ղ͓ͯ͘͠ඞཁ͋Γ