Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Kotlin in Action: what about threads?  RSS feed

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use lots of threads, which often times have listeners, to handle bluetooth and other network kinds of functionality.  Can Kotlin handle threads in a similar manner to standard Java?  Will I be able to mix threaded Java code with threaded Kotlin code and make use of the same listener routines?
 
author
Ranch Hand
Posts: 149
5
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kotlin uses the standard JDK classes for all of its core functionality, including threads. There is no difference between threaded Java code and threaded Kotlin code.

Kotlin's coroutines often provide a cleaner way to solve problems that are traditionally solved with threads, but you don't need to use them if you prefer to stick to threads.
 
Timothy Gallagher
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks - that'll provide a nice transition
 
Fire me boy! Cool, soothing, shameless self promotion:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!