# Easy Thread: Simplifying Communication Between Threads and the EDT

DevFeed: [Easy Thread: Simplifying Communication Between Threads and the EDT](<https://devfeed.tech/articles/easy-thread-19292.md>)

Original publisher: [Read original article](<https://www.codenameone.com/blog/easy-thread/>)

Author: Shai Almog

Published: 2017-05-08T00:00:00Z

Content type: tutorial

Language: en

Sources: [CodeName One](<https://devfeed.tech/sources/codename-one.md>)

Topics: [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [Concurrent Programming](<https://devfeed.tech/topics/concurrent-programming.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Code](<https://devfeed.tech/topics/code.md>), [Java](<https://devfeed.tech/topics/java.md>)

Tags: [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [callback](<https://devfeed.tech/tags/callback.md>), [code](<https://devfeed.tech/tags/code.md>), [future](<https://devfeed.tech/tags/future.md>), [java](<https://devfeed.tech/tags/java.md>), [programming](<https://devfeed.tech/tags/programming.md>), [thread](<https://devfeed.tech/tags/thread.md>), [threading](<https://devfeed.tech/tags/threading.md>), [threads](<https://devfeed.tech/tags/threads.md>)

## AI overview

This tutorial presents an Easy Thread utility for Codename One that runs tasks on background threads, transfers results through callbacks, and dispatches callbacks asynchronously to the EDT. It also describes simplified synchronous variants and a method for stopping a thread and releasing its resources.

## Source excerpt

Working with threads is usually ranked as one of the least intuitive and painful tasks in programming. This is such an error prone task that some platforms/languages took the route of avoiding threads entirely. I needed to convert some code to work on a separate thread but I still wanted the ability to communicate and transfer data from that thread. This is possible in Java but non-trivial, the thing is that this is relatively easy to do in Codename One with tools such as callSerially I can let arbitrary code run on the EDT. Why not offer that to any random thread?