What's the best way to communicate between processes?

awmcclain.nospam at gmail.com awmcclain.nospam at gmail.com
Wed Sep 27 12:56:07 EDT 2006


In general, are sockets used for intra-machine communication less
likely to fail/hang than, say, trying to connect across countries? I
would think so, right?

How do web servers handle connections to SQL databases? Do they spawn a
thread? Or is it all inline? Seems like that's the type of
behaviour/connection I'd like to model.



Lawrence D'Oliveiro wrote:
> In message <1159346472.574859.64130 at i42g2000cwa.googlegroups.com>,
> awmcclain.nospam at gmail.com wrote:
>
> > I'm thinking about coding some sort of 'local notify server' in twisted
> > (basically just listening to a socket and then passing the information
> > to the IM bot), then connecting to it via a python socket in django and
> > passing some serialized/pickled data.
>
> That sounds like the right sort of thing. I've done this sort of thing
> myself, though I've been careful not to use any language-specific
> communication formats.
>
> > I worry about two requests
> > connecting to the 'notify server' at once, though, because i *cannot*
> > hang my web server.
>
> Your Web server won't hang. The particular Web server thread/process waiting
> for the request to be serviced will be held up, and so of course will the
> particular user sitting in front of the browser waiting for a response from
> that thread/process, but nobody else will notice anything.




More information about the Python-list mailing list