Closed Bug 710963 Opened 14 years ago Closed 11 years ago

Improve delegate callback deferral

Categories

(Firefox for Android Graveyard :: Android Sync, defect, P4)

All
Android
defect

Tracking

(fennec+)

RESOLVED INVALID
Tracking Status
fennec + ---

People

(Reporter: rnewman, Unassigned)

References

Details

(Whiteboard: [mentor=rnewman])

The entire Sync implementation is structured around delegate callbacks. Sometimes it also uses locks. Mixing both synchronous and asynchronous invocation of callbacks with locks is a recipe for disaster -- either you'll get deadlocks, or you'll get recursive lock entry with mismatched notify/waits. The "live" portion of the code now has a .deferredFooDelegate() method on each delegate interface, which returns a wrapper around the delegate implementation. This should be switched to use either a common thread (pool) or an event loop. Additionally, the remaining less-used delegate interfaces should be extended in the same way. If you don't understand one of the terms in the preceding three paragraphs, please don't attempt to fix this bug.
This now uses a thread pool, but I'd prefer to avoid even that.
We now use single-thread-pool ExecutorServices in most places. We might be able to do better than that, and we also need to use them in more places: Bug 713483.
Depends on: 713483
Assignee: nobody → rnewman
Status: NEW → ASSIGNED
tracking-fennec: --- → ?
tracking-fennec: ? → +
Priority: P2 → P4
Assignee: rnewman → nobody
Status: ASSIGNED → NEW
Product: Mozilla Services → Android Background Services
Whiteboard: [mentor=rnewman]
The issues that we were worried about have largely not transpired; we have discovered patterns that work well in practice, and we're not going to retro-fit a lot of code for small benefit, so closing.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
Product: Android Background Services → Firefox for Android
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.