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


Groups > comp.lang.python > #99289 > unrolled thread

Re: Bi-directional sub-process communication

Started byIsrael Brewster <israel@ravnalaska.net>
First post2015-11-23 15:27 -0900
Last post2015-11-23 15:27 -0900
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#99289 — Re: Bi-directional sub-process communication

FromIsrael Brewster <israel@ravnalaska.net>
Date2015-11-23 15:27 -0900
SubjectRe: Bi-directional sub-process communication
Message-ID<mailman.82.1448324863.2291.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web