News for hackers. Stuff that matters.
Re:Making the Tokio scheduler 10x faster by weavie on Tuesday October 15, 2019 @03:54AM (#21256400)
Is there a recommended approach to dealing with the occassional cpu intensive task?

Supposing you were running an http server and most responses were very quick - but occassionally a request came along that required calculating pi to the n billionth digit.. (for example).. Would you need to farm that request to a separate process - or could you keep it in process but in a separate thread outside of Tokio?

Re:Making the Tokio scheduler 10x faster by carllerche on Tuesday October 15, 2019 @08:15AM (#21257623)
Right now, CPU intensive code blocks or code blocks that block need to be annotated. This way, the scheduler can respond accordingly (cooperative).
Re:Making the Tokio scheduler 10x faster by nicoburns on Tuesday October 15, 2019 @04:44AM (#21256648)
I believe tokio-threadpool is designes for this scebario.