Eventlet vs Greenlet vs gevent?

I am trying to create a GUI infrastructure that will have an event loop. some threads to handle the user interface, and some to handle events. I searched a bit and found these three libraries, and I wonder which one is better to use? what are the pros and cons?

I could use one of these three libraries or even create something for myself using python threads or a parallel library.

I would appreciate an exchange of experience, comparison and comparison.

+7
python multithreading gevent eventlet greenlets
source share
1 answer
  • For this purpose, you definitely do not need greenery, because it is a low-level library on top of which you can create libraries of light streams (for example, Eventlet and Gevent).
  • Eventlet, Gevent and other similar libraries provide an excellent set of tools for tasks related to IO (waiting for read / write on a file, network).
  • Most of your GUI will probably be waiting for other threads (green / light / OS thread doesn't matter at that moment) to finish, which is an ideal target for the above libraries.
  • All green thread libraries are basically the same. Try it all and decide which one is best for your project.
  • But it is also possible that you will need to extract some things into a separate OS stream due to the requirements of the OS level GUI level.
  • Given this and the best implementation of thread blocking in Python3, you can simply use your own threading module if your application does not need hundreds or more threads.
+7
source share

All Articles