Francois Lepoutre
francois.lepoutre at seriatim.com
Fri Sep 21 09:59:05 EST 2001
Threading ... I am quite a newbie in this area. I Tried quite a bit of "trial and errors" with both the standard threading and mutex python libs in our script (lock, mutex...) however. The idea was to try ensure that the mxodbc code is run in a protected environment where the sql code is run in a round-robin way. With no success. Any chance we can do that... By the way i'd be glad to try the whole thing on mod_python 3 on win32/apache2 when available. In case of pb we will have to switch to a "closed" *nix only-approach. Thanks for mod_python. Great. Simple and fast. No fuss. That the way i like it with IT :) -----Message d'origine----- De : grisha at modpython.org [mailto:grisha at modpython.org] Envoye : 21/09/01 03:52 A : Franзois Lepoutre Cc : mod_python at modpython.org Objet : Re: [mod_python] threading issue on win2k The problem may be with the odbc driver. I don't know about this particular one (sybase), but I know that some of the very latest m$ access and sql server odbc drivers are still not thread safe. The link below seems to be confirming my theory: http://groups.google.com/groups?hl=en&selm=397EE72C.3AC8E5DE%40ever.ever Grisha On Tue, 18 Sep 2001, [iso-8859-1] FranГois Lepoutre wrote: > Hi all, > > Just a few words to say that i discovered python and mod_python a few months ago. > > Developping with these tools has been one of my greatest programming > pleasure (the previous was smalltalk a century ago...). > > However I have a nasty pb to solve which seems to be windows-specific and > related to windows threading. > > The configuration: > - W2000 server, > - python 2.1 + mxodbc, > - apache 1.3.20 > - mod_python 2.7.4 for 2.1 > > Under heavy loads, the the code sequence that load odbc information > from the db engine (ASA by sybase) seems to break because of > thread concurrency. > > The apache just breaks with log message: > "c:\python21\lib\mod_python\apache.py", line 193, in Dispatch > result=object(req) > IOError: Write failed, client closed connexion > > When putting apache "ThreadPerChild" to 1 instead of 2 to 50, > the pb vanishes... and performance as well. (: > > I'd like to know whether the pb is: > - apache related (is apache 2/win a potential cure?) > - python-related (can we improve our scripts with thread-caring code?) > - modpython-related (should we try to tweak apache.py?) > > I know next to nothing to low-level os issues threads except that they > tend to get in the way of interperters like python... > > Thanks in advance for any piece of advice. > > FranГois > > > >
|