The downside of using fixed threads compared to native gevent greenlets?

I understand that after I called gevent.monkey.patch_all (), the standard streaming module was changed to use potions instead of python streams. Therefore, if I write my application in terms of python threads, locks, semaphores, etc., and then call patch_all, do I get all the benefits of gevent or am I losing something compared to using explicit gevent equivalents?

The motivation behind this question is that I am writing a module that uses some threads / potions and I decide if it is useful to have an explicit transition between using gevent and using threads, or I can just use threading + patch_all, nothing losing.

To put it in code is ...

def myfunction():
  print 'ohai'

Greenlet.spawn(myfunction)

... any other?

import gevent.monkey
gevent.monkey.patch_all()
def mythread(threading.Thread):
  def run(self):
    print 'ohai'

mythread().start()
+5
1

, greenlet : , , .. , , gevent.pool, . Thread .

+2

All Articles