[Stackless] Connecting To A Database

seun.osewa at gmail.com seun.osewa at gmail.com
Fri Jun 8 10:47:39 CEST 2007

Hello Matt,

On 6/8/07, Matt Provost <mprovost at termcap.net> wrote:
> It's been on my list of things to check out but I think the pg8000
> postgres driver is a good candidate. (http://pybrary.net/pg8000/)
> It's written in pure python so you can get at how it handles sockets.

Thanks.  It seems there's even a second pure python driver:
"barebones"?  I love the sound of that.  Sounds like "easy" ;-)

So there's probably a solution in that direction, but I'm hoping a
solution for MySQL will appear because it's more widely used.

> I ran some tests with the pg8000 driver using stacklesssocket and it
> works but it's much slower than using the regular socket code.

I think that's because it uses threading internally.  On my development
system, threading with Stackless absolutely destroys performance.
That's why I had to write my own tiny SCGI server. Being able to do all
the processing in one thread really speeds things up in my benchmarks.
Flup, monkey-patched BasicHTTPserver, etc are slow for this reason.

> But it seems like it wouldn't be that bad to actually get into it and put
> some stackless code directly into the driver instead of trying to trick it
> via stacklesssocket. So you could for example watch a socket and send
> results of a query back over a channel, etc.

Hmmm.  I'll try that with with bpsql, because it's purer (no threads).

Thanks, guys!

Stackless mailing list
Stackless at stackless.com

More information about the Stackless mailing list