Hi!
I'm running a CPU intensive function over multiple tokio tasks while sending stats via a mpsc into another task to print out stats. Initially all the CPU threads are maxed out as expected.
The problem I saw was the total speed drop over time (and CPU usage drop), and suspected that all the tasks ended up running on one thread. After investigating that seems to be the case. Figured it out by adding an occasional print of thread::current().id()
and after 15 or so minutes they all end up being the same thread!
How can I keep them on different threads? Isn't this a strange thing to happen?
Small note: Removing the yield_now()
doesn't make a difference.
tokio = { version = "1.4.0", features = ["full", "rt-multi-thread"] }
Thanks for any help