[go: up one dir, main page]

Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Learning Concurrency in Kotlin
  • Table Of Contents Toc
  • Feedback & Rating feedback
Learning Concurrency in Kotlin

Learning Concurrency in Kotlin

By : Castiblanco Torres
4 (6)
close
close
Learning Concurrency in Kotlin

Learning Concurrency in Kotlin

4 (6)
By: Castiblanco Torres

Overview of this book

Kotlin is a modern and statically typed programming language with support for concurrency. Complete with detailed explanations of essential concepts, practical examples and self-assessment questions, Learning Concurrency in Kotlin addresses the unique challenges in design and implementation of concurrent code. This practical guide will help you to build distributed and scalable applications using Kotlin. Beginning with an introduction to Kotlin's coroutines, you’ll learn how to write concurrent code and understand the fundamental concepts needed to write multithreaded software in Kotlin. You'll explore how to communicate between and synchronize your threads and coroutines to write collaborative asynchronous applications. You'll also learn how to handle errors and exceptions, as well as how to work with a multicore processor to run several programs in parallel. In addition to this, you’ll delve into how coroutines work with each other. Finally, you’ll be able to build an Android application such as an RSS reader by putting your knowledge into practice. By the end of this book, you’ll have learned techniques and skills to write optimized code and multithread applications.
Table of Contents (11 chapters)
close
close

Channels - Share Memory by Communicating

Many errors related to concurrency happen when memory is shared between different threads, for example, having an object that will be modified by different threads. Sharing memory this way is dangerous because unless there's bulletproof synchronization, there will be scenarios in which the shared object will enter a state that it should never enter—and writing bulletproof synchronization is more difficult than it may seem.

Deadlocks, race conditions, and atomicity violations are related to shared states. Sometimes they happen because a shared state is invalid, and other times they will cause the state to become inconsistent.

In order to overcome these issues, modern programming languages like Kotlin, Go, and Dart provide channels. Channels are tools that will help you write concurrent code, which, instead of sharing a state...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
notes
register here to use this feature" > bookmark Notes and Bookmarks register here to use this feature" > search Search in title register here to use this feature" > playlist Add to playlist register here to use this feature" > download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon