Displaying 5 results from an estimated 5 matches for "io_del".
2018 Feb 27
1
tinc 1.1: missing PONG
On Tue, 27 Feb 2018 08:12:53 +0100, Guus Sliepen wrote:
> I was thinking by setting a flag whenever we call io_del(), and checking
> that flag in the for-loop in event_loop().
So basically you would store a generation number in the tree that
gets incremented by a call to io_del()? Or should the flag/number
be changed each time the order of the tree changes?
> > Changing the order of the events chang...
2018 Feb 26
2
tinc 1.1: missing PONG
On Mon, 26 Feb 2018 23:01:29 +0100, Guus Sliepen wrote:
> The problem is not the order of the events, the problem is that in the
> Windows version of the event loop, we only handle one event in each loop
> iteration. The select() loop handles all events that have accumulated so
> far, so regardless of the order it handles them, it never starves fd. At
> least, that was what I
2018 Feb 27
2
tinc 1.1: missing PONG
...her than the first one returned. I've also added a
map of io_t to events[] index so avoid the need for splay_search().
The value of event_count will change if a callback adds an event
so we need to handle that.
I've added a generation number to the splay tree head that gets
incremented by io_del(). I'm undecided whether it should also be
incremented by io_add().
Does this seem like the right direction?
- todd
diff --git a/src/event.c b/src/event.c
index 33d205a..b60a6d7 100644
--- a/src/event.c
+++ b/src/event.c
@@ -387,71 +389,89 @@ bool event_loop(void) {
Note that technic...
2018 Feb 27
0
tinc 1.1: missing PONG
...terator due to a callback. It should be easy to
> > detect that and only exit the loop early if that's really the case. I'll
> > do that.
>
> How would you detect that? By checking whether the next node has
> changed?
I was thinking by setting a flag whenever we call io_del(), and checking
that flag in the for-loop in event_loop().
> Changing the order of the events changes the index of which event
> is returned by WSAWaitForMultipleEvents(). Moving the most recently
> accessed event to the end gives the others a chance to proceed.
But it doesn't order...
2018 Feb 27
0
tinc 1.1: missing PONG
...index so avoid the need for splay_search().
That's great, less changes to the tree are good.
> The value of event_count will change if a callback adds an event
> so we need to handle that.
>
> I've added a generation number to the splay tree head that gets
> incremented by io_del(). I'm undecided whether it should also be
> incremented by io_add().
That would probably be nice to do, although the code in event.c doesn't
depend on that.
> Does this seem like the right direction?
[...diff...]
That all looks very good!
--
Met vriendelijke groet / with kind r...