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.5k
並行・並列処理のテストは難しい
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.3k
Libraの現状と技術面をざっくりと / astudy20191114
akihito_nakano
4
1.1k
カート刷新プロジェクトにおけるOpenAPIを活用したコード自動生成の今と明日 / astudy20190419
akihito_nakano
2
600
平静を保ち、コードを生成せよ 〜 OpenAPI Generator誕生の背景と軌跡 〜 / gunmaweb34
akihito_nakano
25
55k
プライベートAPIのクライアントをいい感じにしたい / pepabo_ec_tech_mtg02
akihito_nakano
0
1.7k
サーキットブレーカー 〜 有料契約店舗数 国内 No.1 ECサービスに神を宿す 〜 / pepabo_ec_tech_mtg01
akihito_nakano
1
4k
並列処理で消耗しているかたへ - Snidel のご紹介 -
akihito_nakano
4
3.5k
Other Decks in Programming
See All in Programming
Amazon Bedrockマルチエージェントコラボレーションを諦めてLangGraphに入門してみた
akihisaikeda
1
200
Domain-Driven Design (Tutorial)
hschwentner
13
22k
Lambdaの監視、できてますか?Datadogを用いてLambdaを見守ろう
nealle
2
930
Denoでフロントエンド開発 2025年春版 / Frontend Development with Deno (Spring 2025)
petamoriken
0
1k
Jasprが凄い話
hyshu
0
260
フロントエンドのチューニングに挑戦してみる
jdkfx
0
120
「その気にさせる」エンジニアが 最強のリーダーになる理由
gimupop
3
400
Modern Angular with Signals and Signal StoreNew Rules for Your Architecture @bastacon 2025 in Frankfurt
manfredsteyer
PRO
0
180
SwiftUI移行のためのインプレッショントラッキング基盤の構築
kokihirokawa
0
230
ABEMA iOS 大規模プロジェクトにおける段階的な技術刷新 / ABEMA iOS Technology Upgrade
akkyie
1
280
아직도 SOLID 를 '글'로만 알고 계신가요?
sh1mj1
0
320
Node.js, Deno, Bun 最新動向とその所感について
yosuke_furukawa
PRO
5
2.8k
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7.1k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
40
2k
Faster Mobile Websites
deanohume
306
31k
Reflections from 52 weeks, 52 projects
jeffersonlam
349
20k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
50
2.3k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.2k
Code Reviewing Like a Champion
maltzj
521
39k
Docker and Python
trallard
44
3.3k
Large-scale JavaScript Application Architecture
addyosmani
511
110k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Writing Fast Ruby
sferik
628
61k
Build The Right Thing And Hit Your Dates
maggiecrowley
34
2.6k
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 ݟΛڞ༗͍͖ͯ͠·͠ΐ͏ʂʂ̍