Re: ZODB and asyncio interaction

Jim Fulton <[email protected]>
Newsgroups gmane.comp.web.zope.zodb
Message-ID <CAPDm-FiGT10_Nw-=2taJdPpxi1HdLPdSiD+C8nC5Hhxsaox6gw@mail.gmail.com>
On Fri, Apr 22, 2016 at 11:18 AM, Jesus Cea <[email protected]> wrote:
> On 22/04/16 15:24, Jason Madden wrote:
>> Now greenlets are basically just extremely lightweight threads, and
>> python threads release the GIL when they do socket IO, so the same
>> principles apply to using a thread pool. And all of Jim's remarks
>> remain true. I will say that we've had good results applying
>> gevent+ZODB in an environment where large numbers of threads would
>> make for different tradeoffs (large numbers of persistent WebSocket
>> connections).
>
> Yes, this is what I have using for ages, threads or thread-like
> approaches. Clean and easy. People argue that threads are error prone,
> but being disciplined with intercommunication is all it takes.

Yup.

> My problem, though, is that more and more ecosystem is moving to asyncio
> model (I am quite quite skeptical about it, I rather prefer threads or
> if they are too heavy for the application, greenlets) and transparent
> persistence as provided by ZODB or DURUS are fundamentally incompatible
> with asyncio, AFAIK.
>
> I was wondering about if this conclusion is right or I am missing something.

To some degree, I think asynchronous models for applications is a fad, that's
driven by Node, which is driven by patterns that make some sense in the browser.
It will pass IMO. :)

Lot's of popular concurrency models are non-asynchronous, including
Go's goroutines, Erlangs lightweight processes, and Akka's actors (and
future's).  So there's still a lot of fashion on your side. :)
These are all basically the same, BTW, threads (or lighter-weight
mechanisms with the same semantics) communicating via message queues.
And, of course, Python supports this model too, via threads, subprocesses,
greenlets (gevent) and probably more.

Jim

-- 
Jim Fulton
http://jimfulton.info

-- 
You received this message because you are subscribed to the Google Groups "zodb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.