Bug 124 - Android: support sleep / alarm API
Summary: Android: support sleep / alarm API
Status: NEW
Alias: None
Product: resiprocate
Classification: Unclassified
Component: stack (libresip) (show other bugs)
Version: unspecified
Hardware: All All
: P1 enhancement
Assignee: Owner of all unassigned bugs
Depends on:
Blocks: 126
  Show dependency treegraph
Reported: 2016-03-06 06:40 CST by Daniel Pocock
Modified: 2016-06-21 06:04 CDT (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Pocock 2016-03-06 06:40:27 CST
Instead of using normal sleep APIs or loops, make timer classes based on the Android alarm API, so the device can sleep.

For each timer usage in the stack, consider whether it is something that should really wake the device or not.

Look at strategies to merge adjacent timeouts to minimize the number of wakeups.
Comment 1 Sudhakar 2016-06-21 06:04:04 CDT
The existing implementation is using select() to wait until the timeout of next timer that is linked with given thread. This results in the thread and possibly the process also sleeping(going to sleep) until the timer fires or an event is triggered on one of the FDs linked to the given thread.
As a consequence, there may not be a need for integrating or using Android sleep or timer primitives.