开发者

Blocking vs. Non Blocking network IO in Python

开发者 https://www.devze.com 2023-03-13 12:18 出处:网络
I have some python code that was written by a developer before me. I开发者_开发知识库t sends UDP messages to nodes in a P2P network. I am writing a parallel version of that code. This code sends multi

I have some python code that was written by a developer before me. I开发者_开发知识库t sends UDP messages to nodes in a P2P network. I am writing a parallel version of that code. This code sends multiple parallel messages to the P2P network. Unfortunately, the code is consuming too much CPU. I am assuming it is because of all the network I/O polling. Will it be a good idea if I used asynchronous I/O (twisted framework)?


Yes.

0

精彩评论

暂无评论...
验证码 换一张
取 消