History log of /unit/src/nxt_timer.c (Results 1 – 9 of 9)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: 1.21.0-1, 1.21.0, 1.20.0-1, 1.20.0, 1.19.0-1, 1.19.0, 1.18.0-1, 1.18.0, 1.17.0-1, 1.17.0, 1.16.0-1, 1.16.0, 1.15.0-1, 1.15.0, 1.14.0-1, 1.14.0, 1.13.0-1, 1.13.0, 1.12.0-1, 1.12.0, 1.11.0-2, 1.11.0-1, 1.11.0, 1.10.0-2, 1.10.0-1, 1.10.0, 1.9.0-1, 1.9.0, 1.8.0-1, 1.8.0
# 959:159b672b12ce 26-Feb-2019 Valentin Bartenev

Fixed violation of the strict aliasing rules in 5d0edd35c4ce.

In order to reduce number of operations over rb-tree and process them in
batches simultaneously, all the timers changes are temporary st

Fixed violation of the strict aliasing rules in 5d0edd35c4ce.

In order to reduce number of operations over rb-tree and process them in
batches simultaneously, all the timers changes are temporary stored in array.
While processing of these changes, the same memory is also used for storing
pointers to postpone timers adding.

As the same block of memory has been referenced by two different types of
pointers (nxt_timer_change_t * and nxt_timer_t **), some compilers may reorder
operations with these pointers and produce broken code. See ticket #221 on
GitHub for a particular case.

Now the same "nxt_timer_change_t" structure is used in both cases.

Also, reverted the -fno-strict-aliasing flag, which has been introduced in
ef76227ec159 as a workaround for this issue.

show more ...


Revision tags: 1.7.1-1, 1.7.1, 1.7-1, 1.7, 1.6-1, 1.6, 1.5-1, 1.5
# 811:d0d9acf87625 22-Oct-2018 Valentin Bartenev

Handling of timers with bias.

Timers that don't require maximum precision (most of them, actually) can be
triggered earlier or later within the bias interval.

To reduce wakeups by timers, the expir

Handling of timers with bias.

Timers that don't require maximum precision (most of them, actually) can be
triggered earlier or later within the bias interval.

To reduce wakeups by timers, the expire function now triggers not only all
timers that fall within the elapsed time, but also those whose bias falls
within this interval.

show more ...


# 810:5d0edd35c4ce 22-Oct-2018 Valentin Bartenev

Timers: separation of delete and insert operations on rbtree.

Delete/insert operation complexity for a red-black tree is O(log n),
where n is the total number of tree elements.

If all delete operat

Timers: separation of delete and insert operations on rbtree.

Delete/insert operation complexity for a red-black tree is O(log n),
where n is the total number of tree elements.

If all delete operations are performed before all insert operations,
the average number of tree elements during an operation will be
lower than in the mixed-operations case.

show more ...


# 809:406d3303632e 22-Oct-2018 Valentin Bartenev

Re-engineered timers.

To optimize rbtree operations, all changes are stored in array and later
processed in batches.

The previous implementation of this mechanics had a number of design flaws.
Each

Re-engineered timers.

To optimize rbtree operations, all changes are stored in array and later
processed in batches.

The previous implementation of this mechanics had a number of design flaws.
Each change was saved in a new array entry; until the changes were applied,
the timer remained in an intermediate state (NXT_TIMER_CHANGING).
This intermediate state didn't allow to identify if time was going to be
disabled or enabled. However, the nxt_conn_io_read() function relied on
this information; as a result, in some cases the read timeout wasn't set.

Also, the nxt_timer_delete() function did not reliably track whether a timer
was added to the work queue. It checked the NXT_TIMER_ENQUEUED state of
a timer, but this state could be reset to NXT_TIMER_DISABLED by a
nxt_timer_disable() call or another nxt_timer_delete() call.

Now, instead of keeping the whole history of the timer's changes, the new
implementation updates the timer state immediately, and only one operation
is added to the array to add or delete timer in the rbtree according
to its final state.

show more ...


Revision tags: 1.4-2, 1.4, 1.3, 1.2, 1.1, 1.0
# 590:cf21ce35aefb 28-Mar-2018 Igor Sysoev

Using type for nxt_msec_diff().


Revision tags: 0.7, 0.6, 0.5
# 494:7c83ddcc1c42 24-Jan-2018 Sergey Kandaurov

Fixed formatting in nxt_sprintf() and logging.


Revision tags: 0.4, 0.3
# 388:b459d5aa0701 27-Nov-2017 Igor Sysoev

Timer should be marked as it is not in tree after deletion.

This closes #64 issue on GitHub.


Revision tags: 0.2, 0.1
# 7:be7025f805f4 31-Jan-2017 Igor Sysoev

Event engine timers refactoring.


# 6:6b3ce47b7663 30-Jan-2017 Igor Sysoev

nxt_event_timer has been renamed to nxt_timer.