RE: [Zope] Zope, performance and multithreading (beginner questio ns)
-----Original Message----- From: Andy Dustman [mailto:adustman@comstar.net] Sent: Friday, July 09, 1999 12:52 PM To: Rob Page Cc: 'Alexander Staubo'; 'zope@zope.org' Subject: RE: [Zope] Zope, performance and multithreading (beginner questio ns)
I mentioned this (buried in another thread), but I have a MySQLdb module for Python that is completely thread-safe (i.e. it releases the global interpreter lock on blocking calls). It's mostly compatible with MySQLmodule-1.4 (what ZMySQLDA uses) so it should be easily adaptable to Zope, except for the fact that it does try to use mxDateTime, which conflicts name-wise with Zope's DateTime. If any changes are required to make it work with Zope (it should probably have it's own ZMySQLdbDA), let me know.
I would suggest against two DA from the same database. We are in a stitch right now because we have two Sybase DAs, one we wrote that we never released, and one Brian Hooper wrote that is the community DA, the problem is, our consulting customers use ours, and everybody else uses Brian's. We want to officially support Sybase, and we'll probably end up with something between the two of them, and call it 'official'. So I would suggest we, as a community, huck the old DA that has served us so well in our non-threaded days and rewrite it to use your threadsafe module. As you suggested, this should be pretty a pretty low calorie change since python has a little secret the rest of the world has yet to find out about, standard interfaces! So now we need a volunteer to rewrite the DA. Paul has officially pledged to send a wav file of him making kissing/lovey sounds to whomever takes on the task. -Michel PS: I'll leave this link here cuz it's cool: http://starship.python.net/crew/adustman/MySQLdb.html
On Fri, 9 Jul 1999, Michel Pelletier wrote:
PS: I'll leave this link here cuz it's cool: http://starship.python.net/crew/adustman/MySQLdb.html
Thanx. One caveat: I still consider this module somewhat alpha. That's not to say it's completely untested. I borrowed/hacked Marc-Andre Lemburg's test script from mxODBC to thrash multiple client threads (I think I went up to eight) for more than an hour with no memory leaks or corruption. I have also had a couple people report that it works. The project that I wrote the thing for has been somewhat delayed, so I haven't done much real-life personal testing. It's near-beta. I would have released a beta the other night but I'm coping with a drive failure at this point and can't really compile anything. (The only difference between my CVS version and the one on the Starship are some backslashes in the C to make a certain DEC compiler happy, and a one-liner in the Python side of the interface, which makes the rowcount adhere closer to the DB API spec.) In a nutshell, it's a split interface. The C module (_mysql) adds a little object abstraction to the standard MySQL interface, and the Python module (MySQLdb) is a fairly thin wrapper to make it compatible with the DB API. Conceivably, the ZMySQLDA could use _mysql directly. I see ZxDA as a sort of alternative DB interface spec anyway, and probably there are a few things in MySQLdb that aren't needed for ZMySQLDA. This seems pretty reasonable as the current ZMySQLDA is not using the DB API 1.0 wrapper for MySQLmodule, so why wrap another wrapper?... -- andy dustman | programmer/analyst | comstar communications corporation telephone: 770.485.6025 / 706.549.7689 | icq: 32922760 | pgp: 0xc72f3f1d
participants (2)
-
Andy Dustman -
Michel Pelletier