Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #99289

Re: Bi-directional sub-process communication

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Israel Brewster <israel@ravnalaska.net>
Newsgroups comp.lang.python
Subject Re: Bi-directional sub-process communication
Date Mon, 23 Nov 2015 15:27:39 -0900
Lines 62
Message-ID <mailman.82.1448324863.2291.python-list@python.org> (permalink)
References <B819AD72-C0F9-4E6C-992A-5E5556979883@ravnalaska.net> <v1a75bt3d76ve8946k04g43p6t1v911nq1@4ax.com>
Mime-Version 1.0 (Mac OS X Mail 9.1 \(3096.5\))
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding quoted-printable
X-Trace news.uni-berlin.de 3+kCvJsh58wljRl7R3blNwJ3vU3rzLKHDB1t61VljPVw==
Return-Path <israel@ravnalaska.net>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.015
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'receives': 0.03; 'subject:skip:c 10': 0.07; 'cc:addr:python-list': 0.09; 'cherrypy': 0.09; 'concern:': 0.09; 'subject:process': 0.09; 'threads,': 0.09; '23,': 0.16; 'command;': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'slave': 0.16; 'subject:sub': 0.16; 'threads': 0.16; 'wrote:': 0.16; 'url:home': 0.18; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'trying': 0.22; 'cc:no real name:2**0': 0.22; 'seems': 0.23; 'header:In-Reply- To:1': 0.24; 'mon,': 0.24; 'requests': 0.25; 'skip:- 40': 0.25; 'sort': 0.25; 'said,': 0.27; 'locks': 0.29; 'queue': 0.29; 'objects': 0.29; 'url:mailman': 0.30; 'work.': 0.30; 'class': 0.33; 'url:python': 0.33; 'url:listinfo': 0.34; 'could': 0.35; 'nov': 0.35; 'but': 0.36; 'should': 0.36; 'there': 0.36; 'url:org': 0.36; '(and': 0.36; 'child': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'charset:us-ascii': 0.37; 'shared': 0.38; 'speak': 0.38; 'means': 0.39; 'enough': 0.39; 'subject:-': 0.39; 'url:mail': 0.40; 'still': 0.40; 'some': 0.40; 'header:Message-Id:1': 0.61; 'side': 0.62; 'per': 0.62; 'information': 0.63; 'between': 0.65; 'received:10.9': 0.66; 'reply': 0.68; 'received:12': 0.81; 'packet.': 0.84; 'shared,': 0.84; 'alaska': 0.91; 'dennis': 0.91; 'do:': 0.91
X-Warning RFC compliance checks disabled due to whitelist
X-Warning Reverse-Path DNS check skipped due to whitelist
X-Warning Maximum message size check skipped due to whitelist
X-Warning Realtime Block Lists skipped due to whitelist
X-Warning System filters skipped due to whitelist
X-Warning Domain filters skipped due to whitelist
X-Warning User filters skipped due to whitelist
X-Warning Anti-Spam check skipped due to whitelist
X-Whitelist 2147483645
X-Envelope-From israel@ravnalaska.net
X-Envelope-To wlfraed@ix.netcom.com
In-Reply-To <v1a75bt3d76ve8946k04g43p6t1v911nq1@4ax.com>
X-Mailer Apple Mail (2.3096.5)
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:99289

Show key headers only | View raw


On Nov 23, 2015, at 3:05 PM, Dennis Lee Bieber <wlfraed@ix.netcom.com> wrote:
> 
> On Mon, 23 Nov 2015 08:54:38 -0900, Israel Brewster <israel@ravnalaska.net>
> declaimed the following:
> 
>> Concern: Since the master process is multi-threaded, it seems likely enough that multiple threads on the master side would make requests at the same time. I understand that the Queue class has locks that make
> 
> 	Multiple "master" threads, to me, means you do NOT have a "master
> process".

But I do: the CherryPy "application", which has multiple threads - one per request (and perhaps a few more) to be exact. It's these request threads that generate the calls to the child process.

> 
> 	Let there be a Queue for EVERY LISTENER.
> 
> 	Send the Queue as part of the request packet.

No luck: "RuntimeError: Queue objects should only be shared between processes through inheritance"

This IS a master process, with multiple threads, trying to communicate with a child process. That said, with some modifications this sort of approach could still work.

-----------------------------------------------
Israel Brewster
Systems Analyst II
Ravn Alaska
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7293
-----------------------------------------------


> 
> 	Let the subthread reply to the queue that was provided via the packet
> 
> 	Voila! No intermixing of "master/slave" interaction; each slave only
> replies to the master that sent it a command; each master only receives
> replies from slaves it has commanded. Slaves can still be shared, as they
> are given the information of which master they need to speak with.
> 
> 	
> 
> -- 
> 	Wulfraed                 Dennis Lee Bieber         AF6VN
>    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Bi-directional sub-process communication Israel Brewster <israel@ravnalaska.net> - 2015-11-23 15:27 -0900

csiph-web