Thread: [Karrigell-main] Threading or not threading ?
Brought to you by:
quentel
From: <que...@wa...> - 2003-11-25 09:42:23
|
Working on a debugger for Karrigell I again faced difficulties with HTML frames : sometimes the output of the scripts seems to be sent at random to one of the frames. I thought the HackedStdout solved the problem but obviously it doesn't There is a simple solution to this : use TCPServer instead of ThreadingTCPServer and remove all the HackedStdout "magic". The tests I've made (subjective, I didn't use any load test tool) don't show any difference of speed and anyway Karrigell isn't designed for heavy loads Do you see any problem with switching to this non-threaded version ? Regards, Pierre |
From: Remco B. <rb...@ip...> - 2003-12-01 11:51:37
|
PE1FVEEgSFRUUC1FUVVJVj0iQ29udGVudC1UeXBlIiBDT05URU5UPSJ0ZXh0L2h0bWw7IGNoYXJz ZXQ9dXRmLTgiPgoKPCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDMuMi8v RU4iPgo8SFRNTD4KPEhFQUQ+Cgo8TUVUQSBOQU1FPSJHZW5lcmF0b3IiIENPTlRFTlQ9Ik1TIEV4 Y2hhbmdlIFNlcnZlciB2ZXJzaW9uIDYuMC41NzYyLjMiPgo8VElUTEU+UmU6IFtLYXJyaWdlbGwt bWFpbl0gVGhyZWFkaW5nIG9yIG5vdCB0aHJlYWRpbmcgPzwvVElUTEU+CjwvSEVBRD4KPEJPRFkg ZGlyPWx0cj4KPERJVj5bZHVlIHRvIGFuIGVycm9yIGFwcGVhcmluZyBvbiB0aGUgc291cmNlZm9y Z2UgbGlzdCBhcmNoaXZlLCB0aGlzIGlzIGEgCnJlcG9zdF08L0RJVj4KPERJVj4mbmJzcDs8L0RJ Vj4KPERJVj5IaSwgPC9ESVY+CjxESVY+Jm5ic3A7PC9ESVY+CjxESVYgZGlyPWx0cj5JIGNhbiBp bWFnaW5lLiBJIGhhdmUgdGhlIHNhbWUgcHJvYmxlbSBzb21ldGltZXMuLiBhIG5vbi10aHJlYWRl ZCAKc3lzdGVtIHdvdWxkIGFsc28gcmVkdWNlPC9ESVY+CjxESVYgZG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9TVFJPTkc+DQo8SFI+DQo8L0JPRFk+CjwvSFRNTD4= |
From: quentel.pierre <que...@wa...> - 2003-12-01 20:24:26
|
Re: [Karrigell-main] Threading or not threading ?Since no one voted = against, I have cvs'd a new version of Karrigell which uses a = non-threading server. I've also cleaned up the code a bit : the handling = of POST requests, which is not specific to Karrigell, is now in a = CustomHTTPServer script. I hope this will make Andrew's task of porting = to Apache easier ; I don't think it should significantly slow down the = server (but tell me if I'm wrong) I don't know if Remco's suggestion could be achieved, but if there is no = big speed issue with the non-threaded version I think it's much safer to = stick to only one implementation of the server I also tried to use the asyncore / asynchat framework to build a faster = server. The result is in the CVS under "Karrigell_async.py". Not too bad = when it works, but too unstable yet. I have tried to dig into medusa but = I find the code very hard to understand ; if any of you is a medusa = guru, he's much welcome to work on it ! I've also decided to switch to Python2.3 to be able to use new modules = such as date or built-in functions like enumerate. Many scripts have = been rewritten to reduce the use of the string module, introduce list = comprehensions instead of map/filter, etc The "debugger" subdirectory gives access to information about scripts = which raised an exception : a view of the script text and a way to = browse the namespace (this part still uncomplete). I'll need your = feedback on these scripts... Regards, Pierre ----- Original Message -----=20 From: Remco Boerma=20 To: Kar...@li...=20 Sent: Monday, December 01, 2003 12:52 PM Subject: [Karrigell-main] Threading or not threading ? [due to an error appearing on the sourceforge list archive, this is a = repost] Hi,=20 I can imagine. I have the same problem sometimes.. a non-threaded = system would also reduce my 'resource-lock-related-headaches'...=20 Whilst thinking about it, i'm wondering if it could be possible to = handle simple file (no python magic inside) threaded, while maintaining = a non-threading model for python-enhanced files. This would surely = reduce a lot of my problems, while still maintaing a lot of speed (i = will be using a lot of small graphic files, and a whole buch of = iframes..) As most if this would be done in the apache port by apache = itself (i guess), it shouldn't be a to big problem there.. Cheers,=20 Remco que...@wa... wrote: >Do you see any problem with switching to this non-threaded = version ? Hi, No problem at all, in fact the hacked stdout has been causing me = to pull my hair out whilst trying to do the Apache thing. If you get this = sorted I should be able to finish. Cheers, Andy. -------------------------------------------------------------------------= ----- Dit bericht is gecontroleerd op virussen door Mailmarshal software en = Sophos Antivirus Wilt u meer weten over deze producten? Neemt u dan contact op met ICT = Point Telefoon 0592 316311, of bezoek onze website: www.ictpoint.nl=20 -------------------------------------------------------------------------= ----- = N=18HY?=E9=8A=98????u?=16w=1A+m?>????=EB=A2=AAxZ?=E9=B6=97?*m=E9=AD=AA?=DB= =B6+=0E??=D8=96??=CA=AA=D7=BA=DB=AD=CA=B9!DD=10?=11??=E9=BA=88??P)rA?=E8=B6= =9F??q=E7=AE=87z=DF=A2v{=F2=AE=B8=BAYj)j)? = ?=D2=AE?zYj)?=CB=B2?q=E7=AE=87z=D8=AD?????=1E~?=E0=BA=B7??=CB=A2???=07??f= ? |
From: Andrew N. <an...@ni...> - 2003-11-26 12:51:48
|
que...@wa... wrote: >... > > >Do you see any problem with switching to this non-threaded version ? > > Hi, No problem at all, in fact the hacked stdout has been causing me to pull my hair out whilst trying to do the Apache thing. If you get this sorted I should be able to finish. Cheers, Andy. |