Designing a WSGI server in C

1 view
Skip to first unread message

iGL

unread,
Feb 12, 2007, 2:19:46 AM2/12/07
to aspen-users, ch...@zetaweb.com
Hi all,
Here are some random thoughts about porting the cherrypy-based aspen
core into C.

- Request object
The biggest issue here is the speed of parsing the request and
headers. It'd be nice if we find some little BSD-style-licensed lib
written in C, something like libapreq-2, but much simpler. In this
case, we could design a C-based request class using either Pyrex or
ctypes.

- Threading
What if we port the standard threading.py into Pyrex and hence, have a
native high level interface to thread.c? Here is N. Lehuen's recipe on
how one could use pythread.h/thread.c with Pyrex: http://
aspn.activestate.com/ASPN/Cookbook/Python/Recipe/310792
If there's no sufficient gain in performance, we'd get back to the
python implementation...

Another challenge is to avoid GIL altogether on the server level -
leaving it for frameworks to deal with. It's tricky, however.

- Connection and Server
I guess porting them into Pyrex is straightforward. Are there some
pitfalls?

- Last but not least
Probably, we have to keep the current API, - to avoid re-shaping aspen
itself.


giorgi

Reply all
Reply to author
Forward
0 new messages