[sldev] What is eventlet, and why should you care?
Donovan Linden
donovan at lindenlab.com
Mon Sep 24 10:22:23 PDT 2007
Introduction
=====
I'm Donovan Linden (Donovan Preston). I started at Linden in May of
2006 to join Zero Linden (Mark Lentczner) in forming Studio Icehouse,
whose charter is to "modernize" the second life protocol. We have
been slowly doing this by introducing LLSD, capabilities, and
designing web services in a REST-style fashion.
I have been using Python since 2000, and using non-blocking network I/
O (with the Twisted framework) for most of that time. When I started
at Linden, I decided to see if I could use a small open source
coroutine-based networking framework, eventlet, written by a friend
of mine, Bob Ippolito.
Eventlet
=====
Why would I want to use eventlet? Eventlet uses coroutines (with the
help of the greenlet module) to perform high scalability non-blocking
I/O while appearing to the programmer to block. This means code that
looks like:
socket.write('hello world')
Is actually causing a coroutine switch away from this coroutine into
a mainloop coroutine, until the syscall select or poll says that
socket's file descriptor is ready for writing. This gives a nice
balance between the advantages of non-blocking I/O (no preemption and
thus no possibility of deadlock, deterministic control flow) and
blocking I/O (ease of use, ease of composition, ease of error handling).
Usage of eventlet inside of Linden has been a great success. Several
key services have been ported from C++ code which depends on the
central database to distributed Python web services (the "backbone"
architecture). We think the code is small, simple, clear, and
powerful, and we invite others to take a look!
How can you help?
=====
First, I invite you to read the eventlet wiki page, download
eventlet, and try out the examples.
http://wiki.secondlife.com/wiki/Eventlet
Second, Which Linden and I have put together a roadmap for what we
would like to do before declaring eventlet "1.0" and doing an
official release. Please take a look and see if there is anything you
could help with!
http://wiki.secondlife.com/wiki/Eventlet_1.0
Donovan Preston
More information about the SLDev
mailing list