Open Bug 1119864 Opened 7 years ago Updated 2 years ago

investigate using a thread pool for ServiceWorker Cache sqlite IO thread operations

Categories

(Core :: Storage: Cache API, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: bkelly, Unassigned)

References

(Depends on 1 open bug)

Details

Currently each Cache Manager object creates a separate thread to perform IO.  We should investigate sharing threads between managers using a pool construct.  The threads would have to be stable once given to a Manager, though.

Also, consider moving NS_AsyncCopy() IO in FileUtils to STS.
I think it's easier to create own thread pool, especially from the point of view of coordinated shutdown when we get profile-before-change in quota manager.
If you decide to use STS, you can't shutdown it in ShutdownTranscactionService().
Also, not sure if STS can be used from other than the main thread.
Since STS threads stop in shutdown-threads, I do believe I can successfully shutdown Cache if I use STS.  Jan and I talked about this in IRC.

Either way, it would be nice if mozStorage took an nsIEventTarget instead of coupling to the thread the connection is opened on.
Blocks: 1110136
No longer blocks: ServiceWorkers-B2G
Actually... I think we should try to do this in v1.  One of the review comments was that we do not want to create a separate thread for each origin.
Blocks: serviceworker-cache
No longer blocks: 1110136
Blocks: 1110136
No longer blocks: serviceworker-cache
Component: DOM → DOM: Core & HTML
Blocks: 1541373
Component: DOM: Core & HTML → Storage: Cache API
Type: defect → enhancement
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.