Skip to content

Commit

Permalink
book: Start with conclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
Hofer-Julian committed Oct 22, 2023
1 parent 142840b commit 5f21f71
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions book/src/main_event_loop.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,5 +249,11 @@ Filename: <a class=file-link href="https://github.com/gtk-rs/gtk4-rs/blob/master


So when should you spawn an `async` block and when should you spawn a thread?
- If you have `async` functions for your IO-bound operations at your disposal, feel free to spawn them on the main loop.
- If your operation is computation-bound or there is no `async` function available, you have to spawn threads.

# TODO

- computation bound -> threads + channels
- IO:
- if you have glib/smol/async-std functions -> spawn on main loop (+ maybe channels)
- if tokio lib is better -> spawn on tokio + channels
- if those are not good options -> threads + channels

0 comments on commit 5f21f71

Please sign in to comment.