<div dir="ltr"><div class="gmail_default" style="font-family:courier new,monospace"><br></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:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);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>
</div></blockquote><div><br><div class="gmail_default" style="font-family:courier new,monospace;display:inline">... snip ...<br></div> </div><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">
</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></blockquote><div><br><div class="gmail_default" style="font-family:courier new,monospace;display:inline">I should have said 'one child blocking another child', but (more below)<br>
</div> </div><div><div class="gmail_default" style="font-family:courier new,monospace;display:inline">... snip ...<br></div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
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"></div></blockquote><div><br><div class="gmail_default" style="font-family:courier new,monospace;display:inline">You are correct. My problem was that I was attempting to use Coro:async_pool<br>
</div><div class="gmail_default" style="font-family:courier new,monospace;display:inline">thinking that it would allow each RPC invocation to be independent from<br>the 'sleep blocking' perspective, but it won't be. [Coro has its own compatible<br>
</div><div class="gmail_default" style="font-family:courier new,monospace;display:inline">sleep()].<br></div><div class="gmail_default" style="font-family:courier new,monospace;display:inline"></div> </div><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">
> ... 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></blockquote><div><br><div class="gmail_default" style="font-family:courier new,monospace;display:inline">After a number of iterations, I eventually was able to get my multi-fork <br>
ersion to work without errors, and with it, each child's RPC invocation<br>is indeed separate.</div> </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
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<div class="gmail_default" style="font-family:courier new,monospace;display:inline">?</div></blockquote><div> </div><div><span style="font-family:courier new,monospace">In the <div class="gmail_default" style="font-family:courier new,monospace;display:inline">
C</div>oro<div class="gmail_default" style="font-family:courier new,monospace;display:inline">-</div>sleep case, the RPCs returned in<div class="gmail_default" style="font-family:courier new,monospace;display:inline">
t0+1 and t0+3 seconds (as intended).<br>In the Perl-sleep case they return in t0+3 and t0+3+1 seconds.<br><div class="gmail_default" style="display:inline">Its not that the parent ended up being blocked, but the child/child-pool<br>
</div>activity was (as I suppose they would be, its just that I hadn't yet figured<br></div><div class="gmail_default" style="font-family:courier new,monospace;display:inline">out how to code/include what I wanted).<br>
</div><div class="gmail_default" style="font-family:courier new,monospace;display:inline"><br></div></span><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><div class="gmail_default" style="font-family:courier new,monospace;display:inline">Coro timing.<br></div><div class="gmail_default" style="font-family:courier new,monospace;display:inline">
<br></div><div class="gmail_default" style="font-family:courier new,monospace;display:inline">Now back to adding the data-passing parts back in. :-)<br><br></div><div class="gmail_default" style="font-family:courier new,monospace;display:inline">
Thank you for your ongoing help!<br></div><div class="gmail_default" style="font-family:courier new,monospace;display:inline">Fulko<br></div><div class="gmail_default" style="font-family:courier new,monospace;display:inline">
<br></div></div></div></div></div>