News for hackers. Stuff that matters.
Re:A Hitchhiker’s Guide to Asynchronous Programming by 32gbsd on Friday February 28, 2020 @11:28PM (#22448818)
> Python introduced a concept, async/await, to help developers write understandable code with high performance is it actually better or is it just a new kind of threading/loop? being understandable is second fiddle.
Re:A Hitchhiker’s Guide to Asynchronous Programming by gigatexal on Saturday February 29, 2020 @01:00AM (#22449203)
I think C# had it long before python did...
Re:A Hitchhiker’s Guide to Asynchronous Programming by crazyguitar on Saturday February 29, 2020 @12:08AM (#22448991)
async/await is a better design pattern without considering low-level APIs such as epoll. It is not a new kind of threading/loop. Python provides a user-level scheduler for developers, so they don't need to implement their scheduler from scratch. In my opinion, the reason why using an event loop can acquire better performance is to decrease the number of times to lock some critical sections. Also, this pattern can increase the cache hit and mitigate CPU context switch frequency.