What's everyone working on this week (9/2020)

New week, new Rust! What are you folks up to?

Fixing UI bugs in Amethyst, so that I can have a usable text box in my game.
It's amazing how much code needs to be written for a simple text box.

caret_move

2 Likes

I've migrated concurrency in https://lib.rs server from rayon to tokio.

Did you know you can get a deadlock when mixing two async runtimes? I do now! (actix-rt waiting for a future on tokio, tokio waiting for a future on actix-rt, and everything is stuck).

2 Likes

Surely that is not unique to when you have two runtimes? If two futures are waiting for each other, you have a deadlock — even if they're running on the same executor.

trying to understand async/await and why do i need them instead of simply using threads.

In my case waiting is indirect, via tokio::RwLock and Semaphore.

In my case it's because I have a mixed workload where some things are CPU-bound and some things are network bound. Regular thread pools can't support that well, because they can't schedule threads blocked on I/O differently from threads that are running computations, so either the CPU ends up idle because threads are just waiting for the network, or the network is underutilized, because CPU-bound threads haven't had chance to start requests yet. With async it's necessary to split these kinds of tasks, and then the executor can make lots of network requests without increasing number of CPU-bound threads.

Hi. Why did you do that ? Was Rayon not good enough ? Will it be better wth Tokio ?

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.