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
並行・並列処理のテストは難しい
Search
Akihito Nakano
October 27, 2016
Programming
2
4.1k
並行・並列処理のテストは難しい
Akihito Nakano
October 27, 2016
Tweet
Share
More Decks by Akihito Nakano
See All by Akihito Nakano
OpenAPI Generator Meetup #1
akihito_nakano
1
1.1k
Libraの現状と技術面をざっくりと / astudy20191114
akihito_nakano
4
1k
カート刷新プロジェクトにおけるOpenAPIを活用したコード自動生成の今と明日 / astudy20190419
akihito_nakano
2
560
平静を保ち、コードを生成せよ 〜 OpenAPI Generator誕生の背景と軌跡 〜 / gunmaweb34
akihito_nakano
24
52k
プライベートAPIのクライアントをいい感じにしたい / pepabo_ec_tech_mtg02
akihito_nakano
0
1.6k
サーキットブレーカー 〜 有料契約店舗数 国内 No.1 ECサービスに神を宿す 〜 / pepabo_ec_tech_mtg01
akihito_nakano
1
3.7k
並列処理で消耗しているかたへ - Snidel のご紹介 -
akihito_nakano
4
3.3k
Other Decks in Programming
See All in Programming
Prompt FlowによるLLMアプリケーション開発
yuto2000
1
1k
CSC307 Lecture 05
javiergs
PRO
0
210
実用的かつリーズナブルな 「Azure × Gemini × LINE」~キャラクターBot 実装ライブデモ~
tomodo_ysys
1
170
Xcode 16のPreviewModifierと@Previewableを活用した効率的なプレビュー方法の考察
ojun9
2
160
SRE チーム立ち上げ前に考えたこと・取り組んだこと / Considerations and Preparations Before Establishing an SRE Team
mackey0225
3
320
12年前の『型システム入門』翻訳の思い出話
mame
11
1.2k
Polarsの成長: v0.14からv1.0までの変遷と今後の展望
zerebom
1
350
【Go言語】ジェネリクス
tomo1227
0
170
CSC307 Lecture 10
javiergs
PRO
0
310
Google's Recipe for Scaling (Web) Security – LocoMocoSec 2024
lweichselbaum
0
170
CSC307 Lecture 11
javiergs
PRO
0
240
生成AIをkintoneに連携してみた
hideg
0
230
Featured
See All Featured
Building Adaptive Systems
keathley
34
2k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
129
32k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
155
14k
Documentation Writing (for coders)
carmenintech
63
4.2k
A designer walks into a library…
pauljervisheath
201
24k
The Cult of Friendly URLs
andyhume
75
5.9k
Building a Modern Day E-commerce SEO Strategy
aleyda
25
6.7k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
105
6.8k
Building Better People: How to give real-time feedback that sticks.
wjessup
357
18k
Fantastic passwords and where to find them - at NoRuKo
philnash
42
2.7k
Into the Great Unknown - MozCon
thekraken
20
1.3k
Transcript
தڿਓ(.01&1"#0JOD ʲϖύϘºϓϨΠυʳ5FDI.FFUVQʙࣗಈςετɾ$*ฤʙ ฒߦɾฒྻॲཧͷςετ͍͠
8&#ΞϓϦέʔγϣϯΤϯδχΞ ػೳ։ൃνʔϜ தڿਓ ͖͋ͬʔ !/","/0@"LJIJUP &$ࣄۀ෦Χϥʔϛʔγϣοϓάϧʔϓ IUUQBDLJOUPTIHJUIVCJP
Χϥʔϛʔγϣοϓ
܅ϖύϘͰಇ͔ͳ͍͔ʁ ࠷৽ͷ࠾༻ใΛνΣοΫˠ !QC@SFDSVJU
ฒߦɾฒྻॲཧͷςετ
ฒߦɾฒྻॲཧʁ Կʹ͍ͭͯͷൃදͳͷ͔Πϝʔδ͍͢͠Α͏ʹ ͡Ίʹ໌֬ʹ͓͖ͯ͠·͢ʂ
ฒߦɺฒྻɺඇಉظɺࢄʜ ϚϧνεϨου Ϛϧνϓϩηε ͪ͜Βʹ͍ͭͯͷൃදͰ͢ ཧతʹಠཱͨ͠ෳͷϊʔυͰ ฒߦɾฒྻ
ͳͥฒߦɾฒྻॲཧΛςʔϚʹʁ
ฒߦɾฒྻॲཧɹ׆༻ͷྲྀΕ wϓϩηοαߴԽ͔ΒϚϧνίΞ wϦιʔεΛޮతʹ׆༻͢ΔͨΊʹฒߦɾฒྻॲཧ͕͞ΕΔ wฒߦɾฒྻॲཧ͕ಘҙͳݴޠ͕ʹ w3VCZձٞͰ(VJME͕ఏҊ͞Εͨ
1)1
4OJEFM εφΠσϧ IUUQTHJUIVCDPNBDLJOUPTITOJEFM खܰʹϚϧνϓϩηεͰ͖Δ ࢠϓϩηεͷॲཧ݁ՌΛड͚औΕΔ ϚελʔʗϫʔΧʔϞσϧ 1)1Ҏ্
ϓϧϦΫΤετܴʂ IUUQTHJUIVCDPNBDLJOUPTITOJEFM
ຊ
ฒߦɾฒྻॲཧͷ͠͞Λςετͷ؍Ͱ
λΠϛϯά
ϓϩμΫτίʔυ class Foo def run Thread.new do # ৭ʑ @done
= true end # ৭ʑ end end
ςετίʔυ class FooTest < Test::Unit::TestCase def test_run (foo = Foo.new).run
sleep 1 assert_true foo.done end end
ςετίʔυ class FooTest < Test::Unit::TestCase def test_run (foo = Foo.new).run
sleep 1 assert_true foo.done end end ෆ҆ఆ
εςοϓ ॲཧΛΓग़͢
ϓϩμΫτίʔυ͜ΕΛʜ class Foo def run Thread.new do # ৭ʑ @done
= true end # ৭ʑ end end
ϓϩμΫτίʔυ͜͏ʂ class Foo def run Thread.new do # ৭ʑ @done
= self.do end # ৭ʑ end def do # ৭ʑ true end end
ςετίʔυ͜ΕΛʜ class FooTest < Test::Unit::TestCase def test_run (foo = Foo.new).run
sleep 1 assert_true foo.done end end
ςετίʔυ͜͏ʂ class FooTest < Test::Unit::TestCase def test_run (foo = Foo.new).run
sleep 1 assert_true foo.done end def test_do assert_true Foo.new.do end end
ඇಉظͳ෦Λ ಉظॲཧͱͯ͠ςετͰ͖ΔΑ͏ʹͳͬͨʂ
)VNCMF0CKFDUύλʔϯ Y6OJU5FTU1BUUFSOT$I
͕͔ͩ͠͠
ςετίʔυ·ͩղܾ͍ͯ͠ͳ͍ʜ class FooTest < Test::Unit::TestCase def test_run (foo = Foo.new).run
sleep 1 assert_true foo.done end def test_do assert_true Foo.new.do end end ෆ҆ఆ
εςοϓ ϝοηʔδύογϯάΛ͏
lϝϞϦͷ্ͰγΣΞ͢ΔͷͰͳ͘ ίϛϡχέʔγϣϯͰγΣΞ͢Δz 4J[FE2VFVFΛͬͯ ͦΕͬΆ͍͜ͱΛΓ·͢
ϓϩμΫτίʔυ͜ΕΛʜ class Foo def run Thread.new do # ৭ʑ @done
= self.do end # ৭ʑ end def do # ৭ʑ true end end
ϓϩμΫτίʔυ͜͏ʂ class Foo def initialize @done = SizedQueue.new(1) end def
run Thread.new do # ৭ʑ @done << self.do end # ৭ʑ end … (ུ) … end
ςετίʔυ͜ΕΛʜ class FooTest < Test::Unit::TestCase def test_run (foo = Foo.new).run
sleep 1 assert_true foo.done end def test_do assert_true Foo.new.do end end
ςετίʔυ͜͏ʂ class FooTest < Test::Unit::TestCase def test_run (foo = Foo.new).run
assert_true foo.done.pop end def test_do assert_true Foo.new.do end end
λΠϛϯά ղܾʂ
ଞʹ w εϥΠυͰ൚༻తͳςΫχοΫͷ͝հͰ͕ͨ͠ w ݴޠϑϨʔϜϫʔΫ͕ఏڙ͢Δศརػೳ͋Γ·͢ w ྫ(Pݴޠͷ3BDF%FUFDUPS
·ͱΊ
·ͱΊ w ฒߦɾฒྻॲཧͷ͠͞ʹςετͰର߅Ͱ͖Δ w ಛ༗ͷϓϥΫςΟε͕͋Δ w ݟΛڞ༗͍͖ͯ͠·͠ΐ͏ʂʂ̍