Re: [Python-Dev] threadsafe patch for asynchat

2006-02-09 Thread Guido van Rossum
On 2/7/06, Mark Edgington <[EMAIL PROTECTED]> wrote: > Ok, perhaps the notation could be improved, but the idea of the > semaphore in the patch is "Does it run inside of a multithreaded > environment, and could its push() functions be called from a different > thread?" The long-term fate of asynco

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-09 Thread Donovan Baarda
On Thu, 2006-02-09 at 13:12 +0100, Fredrik Lundh wrote: > Donovan Baarda wrote: > > >> Here I think you meant that medusa didn't handle computation in separate > >> threads instead. > > > > No, I pretty much meant what I said :-) > > > > Medusa didn't have any concept of a deferred, hence the idea

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-09 Thread Fredrik Lundh
Donovan Baarda wrote: >> Here I think you meant that medusa didn't handle computation in separate >> threads instead. > > No, I pretty much meant what I said :-) > > Medusa didn't have any concept of a deferred, hence the idea of using > one to collect the results of a long computation in another

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-09 Thread Donovan Baarda
On Wed, 2006-02-08 at 15:14 +0100, Valentino Volonghi aka Dialtone wrote: > On Wed, Feb 08, 2006 at 01:23:26PM +, Donovan Baarda wrote: > > I believe that Twisted does pretty much this with it's "deferred" stuff. > > It shoves slow stuff off for processing in a separate thread that > > re-syncs

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-08 Thread Josiah Carlson
Mark Edgington <[EMAIL PROTECTED]> wrote: > > Martin v. Löwis wrote: > > That patch looks wrong. What does it mean to "run in a thread"? > > All code runs in a thread, all the time: sometime, that thread > > is the main thread. > > > > Furthermore, I can't see any presumed thread-unsafety in

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-08 Thread Bill Janssen
Not terrible. I think I may try re-working Medusa to use this. Bill ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archi

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-08 Thread Pedro Werneck
On Wed, 08 Feb 2006 15:42:39 +0100 Georg Brandl <[EMAIL PROTECTED]> wrote: > Neal Norwitz wrote: > > On 2/7/06, Christopher Armstrong <[EMAIL PROTECTED]> wrote: > >> > >> Twisted is wonderful, powerful, rich, and very large. Perhaps a > >small > > subset could be carefully extracted > >> > >The s

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-08 Thread Mark Edgington
Martin v. Löwis wrote: > That patch looks wrong. What does it mean to "run in a thread"? > All code runs in a thread, all the time: sometime, that thread > is the main thread. > > Furthermore, I can't see any presumed thread-unsafety in asynchat. Ok, perhaps the notation could be improved, bu

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-08 Thread Barry Warsaw
On Wed, 2006-02-08 at 11:45 -0800, Keith Dart wrote: > There are other, third-party, SMTP server objects available. You could > always use one of those. Very true. In fact, Twisted comes to the rescue again here. When I needed to test Mailman's NNTP integration I could either spend several wee

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-08 Thread Keith Dart
Barry Warsaw wrote the following on 2006-02-08 at 13:45 PST: === > Or the guy who needs to whip together an RFC-compliant minimal SMTP > server to use in unit tests of some random Python implemented mailing > list manager. Just fer instance. But still... > > > But I can't speak for how often thi

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-08 Thread Barry Warsaw
On Wed, 2006-02-08 at 10:24 -0800, Robert Brewer wrote: > It'd be a huge loss for the random fellow who needs to write an email > fixup proxy between a broken client and Exim in a couple of hours. ;) Or the guy who needs to whip together an RFC-compliant minimal SMTP server to use in unit tests o

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-08 Thread Martin v. Löwis
Steve Holden wrote: > In case the processing of events needed to block? If I'm processing web > requests in an async* dispatch loop and a request needs the results of a > (probably lengthy) database query in order to generate its output, how > do I give the dispatcher control again to process th

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-08 Thread Robert Brewer
Barry Warsaw wrote: > On Tue, 2006-02-07 at 16:01 -0800, Robert Brewer wrote: > > > Perhaps, but please keep in mind that the smtpd module uses > > both, currently, and would have to be rewritten if either is > > "removed". > > Would that really be a huge loss? It'd be a huge loss for the rand

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-08 Thread Pedro Werneck
On Wed, 08 Feb 2006 15:42:39 +0100 Georg Brandl <[EMAIL PROTECTED]> wrote: > Neal Norwitz wrote: > > On 2/7/06, Christopher Armstrong <[EMAIL PROTECTED]> wrote: > >> > >> Twisted is wonderful, powerful, rich, and very large. Perhaps a > >small > > subset could be carefully extracted > >> > >The s

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-08 Thread Georg Brandl
Neal Norwitz wrote: > On 2/7/06, Christopher Armstrong <[EMAIL PROTECTED]> wrote: >> >> > Twisted is wonderful, powerful, rich, and very large. Perhaps a small >> > subset could be carefully extracted >> >> The subject of putting (parts of) Twisted into the standard library >> comes up once every

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-08 Thread Aahz
On Wed, Feb 08, 2006, Thomas Wouters wrote: > > Anything beyond simple bugfixes on asyncore/asynchat seems like a terrible > waste of effort, to me. And I hardly ever use Twisted. +1 -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ "19. A language that doesn't affect

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-08 Thread Valentino Volonghi aka Dialtone
On Wed, Feb 08, 2006 at 01:23:26PM +, Donovan Baarda wrote: > I believe that Twisted does pretty much this with it's "deferred" stuff. > It shoves slow stuff off for processing in a separate thread that > re-syncs with the event loop when it's finished. Deferreds are only an elaborate way to d

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-08 Thread Andrew Bennetts
Donovan Baarda wrote: > On Wed, 2006-02-08 at 02:33 -0500, Steve Holden wrote: > > Martin v. Löwis wrote: > > > Tim Peters wrote: > [...] > > > What is the reason that people want to use threads when they can have > > > poll/select-style message processing? Why does Zope require threads? > > > IOW,

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-08 Thread Donovan Baarda
On Wed, 2006-02-08 at 02:33 -0500, Steve Holden wrote: > Martin v. Löwis wrote: > > Tim Peters wrote: [...] > > What is the reason that people want to use threads when they can have > > poll/select-style message processing? Why does Zope require threads? > > IOW, why would anybody *want* a "threads

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-08 Thread Steve Holden
Josiah Carlson wrote: > "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > >>Steve Holden wrote: >> >> What is the reason that people want to use threads when they can have poll/select-style message processing? Why does Zope require threads? IOW, why would anybody *want* a "threadsafe patch

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-08 Thread Thomas Wouters
On Tue, Feb 07, 2006 at 08:53:46PM -0800, Bill Janssen wrote: > Perhaps the right idea is to fix the various problems of asyncore. The problem with making asyncore more useful is that you end up with (a cut down version of) Twisted, although not one that would be able to integrate with Twisted. a

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-07 Thread Josiah Carlson
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > > Steve Holden wrote: > > > > What is the reason that people want to use threads when they can have > > > poll/select-style message processing? Why does Zope require threads? > > > IOW, why would anybody *want* a "threadsafe patch for asynchat"? > > >

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-07 Thread Fredrik Lundh
Steve Holden wrote: > > What is the reason that people want to use threads when they can have > > poll/select-style message processing? Why does Zope require threads? > > IOW, why would anybody *want* a "threadsafe patch for asynchat"? > > > In case the processing of events needed to block? If I'm

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-07 Thread Steve Holden
Martin v. Löwis wrote: > Tim Peters wrote: > >>Bugs and "missing features" in asyncore. For ZEO's purposes, if I had >>designed it, I expect it would have used threads (without asyncore). >>However, bits of code still sitting around suggest that it was at >>least the _intent_ at one time that ZE

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-07 Thread Martin v. Löwis
Tim Peters wrote: > Bugs and "missing features" in asyncore. For ZEO's purposes, if I had > designed it, I expect it would have used threads (without asyncore). > However, bits of code still sitting around suggest that it was at > least the _intent_ at one time that ZEO be able to run without thr

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-07 Thread Tim Peters
[Josiah Carlson] > ... > Back to the topic that Guido was really complaining about: Zope + > asyncore. I don't doubt that getting Zope to play nicely with asyncore > was difficult, It's more that mixing asyncore with threads is a bloody nightmare, and ZEO and Zope both do that. Zope (but not ZEO

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-07 Thread Bill Janssen
> what other reactive socket framework is there that would fit well into > the standard library ? is twisted really simple enough ? I've been very happy with Medusa, which is asyncore-based. Perhaps the right idea is to fix the various problems of asyncore. We might lift the similar code from t

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-07 Thread Neal Norwitz
On 2/7/06, Christopher Armstrong <[EMAIL PROTECTED]> wrote: > > > Twisted is wonderful, powerful, rich, and very large. Perhaps a small > > subset could be carefully extracted > > The subject of putting (parts of) Twisted into the standard library > comes up once every 6 months or so, at least on

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-07 Thread Christopher Armstrong
On 2/8/06, Alex Martelli <[EMAIL PROTECTED]> wrote: > On 2/7/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >... > > what other reactive socket framework is there that would fit well into > > the standard library ? is twisted really simple enough ? > > Twisted is wonderful, powerful, rich, and v

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-07 Thread Barry Warsaw
On Tue, 2006-02-07 at 16:01 -0800, Robert Brewer wrote: > Perhaps, but please keep in mind that the smtpd module uses both, currently, > and would have to be rewritten if either is "removed". Would that really be a huge loss? -Barry signature.asc Description: This is a digitally signed messa

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-07 Thread Josiah Carlson
Guido van Rossum <[EMAIL PROTECTED]> wrote: > IMO asynchat and asyncore are braindead. The should really be removed > from the standard library. The code is 10 years old and represents at > least 10-year-old thinking about how to do this. The amount of hackery > in Zope related to asyncore was out

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-07 Thread Alex Martelli
On 2/7/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: ... > what other reactive socket framework is there that would fit well into > the standard library ? is twisted really simple enough ? Twisted is wonderful, powerful, rich, and very large. Perhaps a small subset could be carefully extracted

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-07 Thread Robert Brewer
Guido van Rossum wrote: > IMO asynchat and asyncore are braindead. The should really be removed > from the standard library. The code is 10 years old and represents at > least 10-year-old thinking about how to do this. The amount of hackery > in Zope related to asyncore was outrageous -- basically

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-07 Thread Fredrik Lundh
Guido van Rossum wrote: > IMO asynchat and asyncore are braindead. The should really be removed > from the standard library. The code is 10 years old and represents at > least 10-year-old thinking about how to do this. strange. I'd say it works perfectly fine for what it was designed for (after

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-07 Thread Guido van Rossum
IMO asynchat and asyncore are braindead. The should really be removed from the standard library. The code is 10 years old and represents at least 10-year-old thinking about how to do this. The amount of hackery in Zope related to asyncore was outrageous -- basically most of asyncore's guts were rep

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-06 Thread Martin v. Löwis
Mark Edgington wrote: > Does anyone have any comments about applying the following patch to > asynchat? That patch looks wrong. What does it mean to "run in a thread"? All code runs in a thread, all the time: sometime, that thread is the main thread. Furthermore, I can't see any presumed thread