Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.068 X-Spam-Evidence: '*H*': 0.87; '*S*': 0.00; 'memory.': 0.05; 'python': 0.09; 'send()': 0.09; ';-)': 0.11; 'stack': 0.15; 'pairs': 0.16; 'socket.': 0.16; 'tcp': 0.16; 'memory': 0.18; 'module': 0.19; 'written': 0.20; 'long,': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'lot.': 0.29; 'objects': 0.29; 'usually': 0.30; 'subject:data': 0.33; 'to:addr:python-list': 0.33; 'times.': 0.33; 'faster': 0.35; 'protocol': 0.35; 'especially': 0.35; 'there': 0.35; 'except': 0.36; 'but': 0.36; 'depends': 0.36; 'anything': 0.36; 'communicate': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'notice': 0.39; 'where': 0.40; 'received:192.168': 0.40; 'most': 0.61; 'helps': 0.63; 'effective': 0.63; 'times': 0.63; 'received:204': 0.72; 'connection.': 0.75; 'difference.': 0.84; 'imagine': 0.96; 'hand,': 0.97 Date: Wed, 01 Aug 2012 13:07:23 +0200 From: Laszlo Nagy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Pass data to a subprocess References: <5017EFB0.6080608@shopzeus.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1343819248 news.xs4all.nl 6939 [2001:888:2000:d::a6]:50833 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:26349 >> The most effective IPC is usually through shared memory. But there is no >> OS independent standard Python module that can communicate over shared >> memory. > It's true that shared memory is faster than serializing objects over a > TCP connection. On the other hand, it's hard to imagine anything > written in Python where you would notice the difference. Well, except in response times. ;-) The TCP stack likes to wait after you call send() on a socket. Yes, you can use setsockopt/TCP_NOWAIT, but my experience is that response times with TCP can be long, especially when you have to do many request-response pairs. It also depends on the protocol design - if you can reduce the number of request-response pairs then it helps a lot.