coroutine

A collection of 2 posts

A Java geek
  • Me
  • Books
  • Speaking
  • Mentions
  • Focus
Dec 16, 2018 coroutine concurrent programming thread

Even and odd with coroutines

Recently, I stumbled upon one of Baeldung’s post showing how to use threads to print odd and even numbers: one thread dedicated to print odd numbers, another one to print even ones. Since I became aware of them, I was very interested in Kotlin coroutines and how they make concurrent programming code easier to read and write. I wanted to check how using coroutines would yield better code. Show me the code This is what I came up with: import java.util.concurrent.ThreadLocalRandom imp

Nicolas Fränkel
May 7, 2017 future kotlin coroutine

Concurrency: Java Futures and Kotlin Coroutines

A long time ago, one had to manually start new threads when wanting to run code concurrently in Java. Not only was this hard to write, it was easy to introduce bugs that were hard to find. Testing, reading and maintaining such code was no walk in the park either. Since that time - and with a little incentive coming from multi-core machines, the Java API has evolved to make developing concurrent code easier. Meanwhile, alternative JVM languages also have their opinion about helping developers writ

Nicolas Fränkel
A Java geek © 2008-2025
v. f32325969478592b3c56e2566b1da38f32e70c50/10035795030
Latest Posts