Integrate the Glib main loop into the libev event loop (C++)
Oleksandr Kozlov
aleks.a.kozlov at gmail.com
Wed Jul 14 18:02:15 CEST 2021
By the way, setting io_collect_interval to 0.1 solves the problem with
hanging
for this simple program that reads a file. However, it doesn't help for a
more
complex program that has a lot of different async calls. Does this
information
give some hints for figuring out a root cause?
On Wed, Jul 7, 2021 at 9:21 PM Marc Lehmann <schmorp at schmorp.de> wrote:
> On Wed, Jul 07, 2021 at 08:59:01AM +0200, Oleksandr Kozlov <
> aleks.a.kozlov at gmail.com> wrote:
> > I've tried to replace std::map with std::vector, but this didn't help.
> > Actually, I used std::list instead of std::vector, because ev::io has
> > a private copy constructor, but we might need to resize a vector
>
> Right, I ould have thought you'd use pointers as you'd have a similar
> problem
> with std::map, but indeed, post-C+03 supports elements without copy
> constructors in some circumstances. Anyway, speed is not your problem.
>
> In any case, this is a guaranteed problöem that needs to be fixed in
> soemway or another.
>
> > By the way, it turned out that C-language implementation from EV::Glib
> > behaves in the same way: also hangs.
>
> Then I would check whether the glib watchers are actually legal.
>
> > It worth to mention, that I've tried to create ev::idle to prevent the
> > event loop
> > from sleeping. This solves the problem with hanging, but the busy loop
> loads
> > CPU for 100%.
>
> I suspect the only realistic way forward is to understand why the program
> is hanging. Hanging in the kernel call is unliekyl to be a problem with
> libev, but more likely a problem with the glib program waiting for events
> when that libev doesn't wait for.
>
> --
> The choice of a Deliantra, the free code+content
> MORPG
> -----==- _GNU_ http://www.deliantra.net
> ----==-- _ generation
> ---==---(_)__ __ ____ __ Marc Lehmann
> --==---/ / _ \/ // /\ \/ / schmorp at schmorp.de
> -=====/_/_//_/\_,_/ /_/\_\
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schmorp.de/pipermail/libev/attachments/20210714/e89611e1/attachment.htm>
More information about the libev
mailing list