<div dir="ltr"><div class="gmail_default" style="font-family:courier new,monospace">Although I did get my bi-directional JSON connected parent/slave<br>test program to work... the 2nd child doesn't communicate.<br><br>

</div><div class="gmail_default" style="font-family:courier new,monospace">[Its attached if anyone cares to look.]<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 20, 2013 at 10:28 AM, Marc Lehmann <span dir="ltr"><<a href="mailto:schmorp@schmorp.de" target="_blank">schmorp@schmorp.de</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="im">On Wed, Nov 20, 2013 at 10:10:06AM -0500, Fulko Hew <<a href="mailto:fulko.hew@gmail.com">fulko.hew@gmail.com</a>> wrote:<br>


> Because Perl threading would force my variable-sharing issues to be<br>
> extremely<br>
> complicated, I wanted to move instead to: a simple, low-count, multi-process<br>
> approach with a simple (JSON) message passing between them.<br>
<br>
</div>For me, that's what AnyEvent::Fork::RPC does (JSON is one of the<br>
serialisation formats it supports out of the box. Soon, I'll add CBOR<br>
which should make it even faster).<br></blockquote></div><div class="gmail_default" style="font-family:courier new,monospace"><div class="gmail_default" style="font-family:courier new,monospace">... so I thought I'd take Marc's suggestion and look at AnyEvent-Fork-RPC.<br>

<br></div><div class="gmail_default" style="font-family:courier new,monospace">a) it operates backwards to what I was trying to do.<br></div><div class="gmail_default" style="font-family:courier new,monospace">   ie. it allows RPCing into child threads, to ask them to be workers.<br>

</div><div class="gmail_default" style="font-family:courier new,monospace">   but what I wanted were workers that allowed RPCing the parent<br></div><div class="gmail_default" style="font-family:courier new,monospace">   to retrieve info regarding what the workers need to do,<br>

<br></div><div class="gmail_default" style="font-family:courier new,monospace">   So, after re-designing to suit this inverse approach, I continued testing...<br><br></div><div class="gmail_default" style="font-family:courier new,monospace">

b) I get further with respect to multi-threaded operation, but it looks like<br>   the RPC/children<font> of an AnyEvent::Fork application must be <font></font>non-blocking,<br><font>   </font>as in the</font><span style="font-weight:normal"><font><br>

<font>      </font>Example 3: Asynchronous backend with Coro</font></span><br><br></div><div class="gmail_default" style="font-family:courier new,monospace">   Unfortunately, my children do (must) block, and that breaks this approach.<br>

<br></div><div class="gmail_default" style="font-family:courier new,monospace">   That's why I wanted 'real' forked children.</div><br><br></div><br></div></div>