in reply to Re: Coro, EV and cede
in thread Coro, EV and cede

I've tried this way at once, but it didn't help.

Probably cede really doesn't give EV control.

Replies are listed 'Best First'.
Re^3: Coro, EV and cede
by ikegami (Patriarch) on Apr 08, 2011 at 17:02 UTC

    Just call sleep instead of cede if it works better.

    But you may want to consider the output I got from different sleep lengths in the second thread. I changed from printing the length to print time().

    Using sleep(0), it takes 9s to do a request. first second second second second second second second second second second second second second second second second 1302281756 second first second second second second second second second second second second second second second second second second second 1302281765 Using sleep(1), it takes 2s to do a request. first second second second 1302281791 first second second 1302281793 first second second 1302281795 Using sleep(2), it takes 1s to do a request. first second 1302281819 first second 1302281820 first second 1302281822 first 1302281823
Re^3: Coro, EV and cede
by ikegami (Patriarch) on Apr 08, 2011 at 15:40 UTC

    It gives control to the coro running EventLoop. But of course, that coro is in the EventLoop call. What about

    async { sleep 60 while 1; }