<div dir="ltr"><div class="gmail_default" style="font-family:courier new,monospace"><div class="gmail_default" style="font-family:courier new,monospace;display:inline">> The newly attached version (because I now have two separate forked<br>
> children (instead of using async_pool)) works the way I need, just like the<br></div>> Coro timing.<br><br></div><div class="gmail_default" style="font-family:courier new,monospace">Sorry, I forgot to attach the code.<br>
<br><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Nov 21, 2013 at 9:36 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thu, Nov 21, 2013 at 09:16:18AM -0500, Fulko Hew <<a href="mailto:fulko.hew@gmail.com">fulko.hew@gmail.com</a>> wrote:<br>
> Sorry again, but I get confused with which is frontend versus backend.<br>
> (_I_ think front end is the parent and backend is the child/children<br>
> where<br>
><br>
> RPC execution takes place.)<br>
<br>
</div>I think the same, that's how it is, even :)<br>
<div class="im"><br>
> I was hoping that a block in the backend wouldn't block 'other' backends.<br>
<br>
</div>I would hope so, too - I wouldn't even know how one child would be able to<br>
block another child process or the parent.<br>
<div class="im"><br>
> > Why do you (wrongly) think that blocking breaks anything? What do you<br>
> > think breaks when you block?<br>
><br>
> I was expecting, that since the RPC is being executed in a 'forked'<br>
> environment, that a block in the RPC would not block the parent<br>
> from issuing another RPC (to effectively another, separate? forked<br>
> environment).<br>
<br>
</div>I expect that, too, and that's also what happens in your example code on<br>
my system.<br>
<div class="im"><br>
> [I attached my test code. If you enable Coro sleep, it works, but<br>
> if you enable the blocking sleep, each RPC invocation blocks everything.]<br>
<br>
</div>I tried your program, but in both cases "calling completed" is printed before<br>
the results come in, so the main program isn't blocked.<br>
<br>
If you mean the child gets blocked, well, that's what your code does, and<br>
that is what you claimed you wanted to have, so I don't think that's what<br>
you mean.<br>
<div class="im"><br>
> ... I also tried creating two AnyEvent::Fork->new()<br>
> that I hoped would duplicate the child in which to execute<br>
> the RPC (similar to your Coro::async_pool), but that created<br>
> even more errors.<br>
<br>
</div>You haven't mentioned any errors yet. What do you mean with "more errors"?<br>
<br>
With Coro's sleep, I get:<br>
<br>
Thu Nov 21 15:29:33 2013 calling add<br>
Thu Nov 21 15:29:33 2013 calling mul<br>
Thu Nov 21 15:29:33 2013 calling completed<br>
Thu Nov 21 15:29:33 2013 add called<br>
Thu Nov 21 15:29:33 2013 mul called<br>
Thu Nov 21 15:29:34 2013 mul returning after 1 second sleep<br>
mul 1,3 3<br>
Thu Nov 21 15:29:34 2013 mul done<br>
Thu Nov 21 15:29:36 2013 add returning after 3 second sleep<br>
add 1,3 4<br>
Thu Nov 21 15:29:36 2013 add done<br>
<br>
with perl sleep, I get:<br>
<br>
Thu Nov 21 15:29:54 2013 calling add<br>
Thu Nov 21 15:29:54 2013 calling mul<br>
Thu Nov 21 15:29:54 2013 calling completed<br>
Thu Nov 21 15:29:54 2013 add called<br>
Thu Nov 21 15:29:57 2013 add returning after 3 second sleep<br>
Thu Nov 21 15:29:57 2013 mul called<br>
Thu Nov 21 15:29:58 2013 mul returning after 1 second sleep<br>
add 1,3 4<br>
Thu Nov 21 15:29:58 2013 add done<br>
mul 1,3 3<br>
Thu Nov 21 15:29:58 2013 mul done<br>
<br>
In both cases the parent wasn't blocked in any way. What output do you<br>
get?<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
The choice of a Deliantra, the free code+content MORPG<br>
-----==- _GNU_ <a href="http://www.deliantra.net" target="_blank">http://www.deliantra.net</a><br>
----==-- _ generation<br>
---==---(_)__ __ ____ __ Marc Lehmann<br>
--==---/ / _ \/ // /\ \/ / <a href="mailto:schmorp@schmorp.de">schmorp@schmorp.de</a><br>
-=====/_/_//_/\_,_/ /_/\_\<br>
</div></div></blockquote></div><br></div>