What are the disadvantages of using cooperative programs in Python?
The purpose of this article is to share with you what are the disadvantages of using Python. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
1. Multicore resources cannot be used: the essence of a co-program is a single thread, which cannot use multiple cores and co-programs of a single CPU at the same time.
2. The upstream itinerary of multi-CPU needs to be coordinated with the process.
Of course, most of the applications you write every day are unnecessary.
Unless it is a cpu-intensive application.
3. Blocking operations (such as IO) block the entire program.
Example
# basic use of collaborative programs Switch between yield and next to switch back and forth between def func1 (): for i in range (11): print (f "first class printing {I} data") yield def func2 (): G = func1 () next (g) for i in range (10): print (f "second class printing {I} data") next (g) If _ _ name__ = "_ _ main__": func2 () Thank you for reading! This is the end of this article on "what are the disadvantages of using Python?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!