How to make gevent blocking "resistent"?

45 views
Skip to first unread message

galfy

unread,
Oct 17, 2012, 11:44:17 AM10/17/12
to gev...@googlegroups.com
In applications that are using gevent the fun stops when you hit a blocking IO operation or long running, non-cooperative code. Now if I want to protect myself from such cases it will be great if "a system" (gevent, greenlets or the python itself) can spawn a thread when it detects that the python execution is blocked. Similar to the quote from this post: http://mail.python.org/pipermail/python-ideas/2012-October/016458.html:

> IIUC in Go this is solved by mixing threads and lighter-weight constructs (say, greenlets) -- if a greenlet gets blocked for I/O, 
> the rest of the system continues to make progress by spawning another thread.

Here is my question: Is it possible to implement this and if the answer is yes - then how? 

Regards,
 Slavey
Reply all
Reply to author
Forward
0 new messages