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
Of concurrency and other demons
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Rodrigo Graciano
January 16, 2021
Technology
0
150
Of concurrency and other demons
Talk about concurrency.
Initially presented at DawsCon with Hillmer Chona
Rodrigo Graciano
January 16, 2021
Tweet
Share
More Decks by Rodrigo Graciano
See All by Rodrigo Graciano
Advancing with Java
graciano
0
17
Your Java isn't the same
graciano
0
220
Cloud Batch
graciano
0
180
Batch Processing
graciano
0
410
Java 9 ao 17 - Oracle no TDC
graciano
0
130
KnoxJava - Java 9-17
graciano
0
170
Java 9 to Java 16: A review of recent changes to the language
graciano
0
160
Java 9 ao 15 - Evolução da Linguagem Java
graciano
0
290
Other Decks in Technology
See All in Technology
Kaggleの経験が実務にどう活きているか / kaggle_findy
sansan_randd
7
1.3k
Agentic Software Modernization - Back to the Roots (Zürich Agentic Coding and Architectures, März 2026)
feststelltaste
1
230
技術的負債の泥沼から組織を救う3つの転換点
nwiizo
8
3.4k
情シスのための生成AI実践ガイド2026 / Generative AI Practical Guide for Business Technology 2026
glidenote
0
180
新職業『オーケストレーター』誕生 — エージェント10体を同時に回すAgentOps
gunta
4
1.7k
AWS DevOps Agent vs SRE俺 / AWS DevOps Agent vs me, the SRE
sms_tech
3
510
スクリプトの先へ!AIエージェントと組み合わせる モバイルE2Eテスト
error96num
0
140
EMからVPoEを経てCTOへ:マネジメントキャリアパスにおける葛藤と成長
kakehashi
PRO
9
1.5k
ナレッジワークのご紹介(第88回情報処理学会 )
kworkdev
PRO
0
170
複数クラスタ運用と検索の高度化:ビズリーチにおけるElastic活用事例 / ElasticON Tokyo2026
visional_engineering_and_design
0
110
作りっぱなしで終わらせない! 価値を出し続ける AI エージェントのための「信頼性」設計 / Designing Reliability for AI Agents that Deliver Continuous Value
aoto
PRO
2
260
楽しく学ぼう!ネットワーク入門
shotashiratori
1
400
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
Site-Speed That Sticks
csswizardry
13
1.1k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
140
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
130
GitHub's CSS Performance
jonrohan
1032
470k
Test your architecture with Archunit
thirion
1
2.2k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
62
51k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
190
Believing is Seeing
oripsolob
1
79
Git: the NoSQL Database
bkeepers
PRO
432
66k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
310
Transcript
None
➔ Software developer - Team lead ➔ Java Champion ➔
Medellin Java Users Group Leader ➔ hibernate/hibernate-validator Contributor ➔ Duke’s Choice Award Winner ➔ Eclipse Collections contributor
➔ Professional with 10+ years ➔ Principal Software Engineer -
NY ➔ NYJavaSIG Leader ➔ graciano.dev ➔ Twitter: @rodrigograciano
• • • •
• Concurrency when we have many task, largely independent, and
we use the same resource to do them at a time • Parallelism is when we want to do one task, and we split up in multiple subtasks
A Thread is an independent path of execution that allows
a program to operate more efficiently by doing multiple things at the same time. Threads can be used to perform complicated tasks in the background without interrupting the main program.
• Synchronous: when we wait to finish a task before
moving to the next one • Asynchronous: when we move to another task before it finishes
• Thread t = new Thread( ()-> this.doSomething( thing ));
t.start(); • ExecutorService executor = Executors.newFixedThreadPool( 10 ); Future<?> future = executor.submit( ()-> this.doSomething( thing )); • CompletableFuture.runAsync( ()-> this.doSomething( thing )); • Thread.builder().virtual().name("name").task(() -> this.doSomething( thing )).start();
None
None
Stream API CompletableFuture Creation Chained operations Return forEach runAsync thenAccept
/ thenRun void map supplyAsync thenApply CompletableFuture<U>
None
CompletableFuture<Void>::runAsync (Runnable runnable) <U> CompletableFuture<U>::supplyAsync (Supplier<U> supplier) CompletableFuture<Void>::runAsync (Runnable runnable,
Executor executor) <U> CompletableFuture<U>::supplyAsync (Supplier<U> supplier, Executor executor)
static ExecutorService newCachedThreadPool() static ExecutorService newFixedThreadPool (int nThreads) static ScheduledExecutorService
newScheduledThreadPool (int corePoolSize) static ExecutorService newSingleThreadExecutor() static ScheduledExecutorService newSingleThreadScheduledExecutor() static ExecutorService newWorkStealingPool()
T::get () throws InterruptedException , ExecutionException T::get (long timeout, TimeUnit
unit) throws InterruptedException , ExecutionException , TimeoutException T::getNow (T valueIfAbsent) T::join()
• • • •