# TIP: Use the Native EDT

DevFeed: [TIP: Use the Native EDT](<https://devfeed.tech/articles/tip-use-the-native-edt-19607.md>)

Original publisher: [Read original article](<https://www.codenameone.com/blog/tip-use-native-edt/>)

Author: Shai Almog

Published: 2017-04-30T00:00:00Z

Content type: tutorial

Language: en

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

Topics: [cross-platform](<https://devfeed.tech/topics/cross-platform.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [ui](<https://devfeed.tech/topics/ui.md>), [Deadlock](<https://devfeed.tech/topics/deadlock.md>), [Android](<https://devfeed.tech/topics/android.md>), [iOS](<https://devfeed.tech/topics/ios.md>), [IO](<https://devfeed.tech/topics/io.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [cross-platform](<https://devfeed.tech/tags/cross-platform.md>), [deadlock](<https://devfeed.tech/tags/deadlock.md>), [io](<https://devfeed.tech/tags/io.md>), [ios](<https://devfeed.tech/tags/ios.md>), [native](<https://devfeed.tech/tags/native.md>), [objective-c](<https://devfeed.tech/tags/objective-c.md>), [ui](<https://devfeed.tech/tags/ui.md>)

## AI overview

This Codename One developer tip explains when native code should run on platform-specific main or EDT threads. It describes differing Android and iOS thread rules, asynchronous and synchronous invocation, and the risk of performance issues or deadlock from blocking synchronous calls.

## Source excerpt

The bootcamp is winding down and I'm finally back to our usual scheduled posts. I'd like to open with a common practice that isn't nearly documented enough: use the native main/EDT threads. Our EDT serves many purposes but one of its biggest roles is portability. By having an EDT we get consistent behavior across platforms. iOS, Android & pretty much any modern OS has an EDT like thread that handles events etc. The problem is that they differ in their nuanced behavior. E.g. Android will usually respect calls off of the EDT and iOS will often crash. Some OS's enforce EDT access rigidly and will throw an exception when you violate that...