# Async/Await effectiveness on a single core computer (linux-rpi)

**URL:** <https://forums.swift.org/t/async-await-effectiveness-on-a-single-core-computer-linux-rpi/63666>\
**Category:** Using Swift\
**Tags:** raspberrypi, linux, asyncawait\
**Created:** [March 13, 2023, 3:54pm UTC](https://forums.swift.org/t/async-await-effectiveness-on-a-single-core-computer-linux-rpi/63666 "2023-03-13T15:54:34Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Max\_Desiatov](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/max_desiatov/32/20654_2.png) [@Max\_Desiatov](https://forums.swift.org/u/Max_Desiatov)\
**Post date:** [March 13, 2023, 4:10pm UTC](https://forums.swift.org/t/async-await-effectiveness-on-a-single-core-computer-linux-rpi/63666/2 "2023-03-13T16:10:02Z")

</div>

> [@theBitThatBytes](#):
>
> I know true concurrency is not possible on a single core

Concurrency is possible on a single core, since concurrency and multi-threading are orthogonal. You can have truly concurrent code running on a single core with event loops (cooperative concurrency) or threads (preemptive concurrency), which is exactly how it worked before multiple cores became widely available on consumer hardware.

> [@theBitThatBytes](#):
>
> but I still feel that some part of async await like thread suspension could increase overall performance. Is this true?

I don't think that performance itself is related to async/await per se in the single-threaded environment. The main question is whether the code you write is blocking or non-blocking.

If your code is non-blocking, you probably already use either callbacks or async/await, and I think there's a general consensus that async/await is easier to maintain than callbacks, especially in terms of error handling.

If your code is blocking and I/O-bound, then _probably_ switching to async/await is easier than switching to callbacks. If your code is CPU-bound, then on a single core suspension points will likely add some overhead, but there unlikely to be a performance benefit.

Of course, I don't know the details of what you write, YMMV. Parts of your application can be I/O-bound and other parts CPU-bound, then using async/await for the former makes sense, but not for the latter.

> [@theBitThatBytes](#):
>
> I'm a little hesitant to just try it out, since compiling the code for the RPI will be quite a pain

I'd recommend cross-compiling if possible, we have [a proposal in review](https://forums.swift.org/t/se-0387-cross-compilation-destination-bundles/62875) that could help with that.

---

_[View the full topic](https://forums.swift.org/t/async-await-effectiveness-on-a-single-core-computer-linux-rpi/63666)._
