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


Groups > comp.lang.python > #99289

Re: Bi-directional sub-process communication

From Israel Brewster <israel@ravnalaska.net>
Newsgroups comp.lang.python
Subject Re: Bi-directional sub-process communication
Date 2015-11-23 15:27 -0900
Message-ID <mailman.82.1448324863.2291.python-list@python.org> (permalink)
References <B819AD72-C0F9-4E6C-992A-5E5556979883@ravnalaska.net> <v1a75bt3d76ve8946k04g43p6t1v911nq1@4ax.com>

Show all headers | 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