bugzilla.mozilla.org will be intermittently unavailable on Saturday, March 24th, from 16:00 until 20:00 UTC.

Share a single worker across all DataStorage instances




Security: PSM
a year ago
a year ago


(Reporter: Ehsan, Unassigned)


Firefox Tracking Flags

(Not tracked)


(Whiteboard: [psm-backlog])



a year ago
Another follow-up from bug 1320533.

Based on a cursory look, I think one thing that we need to be careful about is the mWorkerThread->Shutdown() call in DataStorage::Observe().  When sharing a thread between all of our objects, we need a custom way to handle all of the events and prevent further dispatches from that object, which seems relatively straightforward (we can post a runnable to the thread and wait for that to be executed to know all of the previous runnables have run, and setup a member that signals the "don't dispatch more runnables" state).
Maybe just use an nsThreadPool, which enables us to use multiple threads if necessary (not sure how busy DataStorage is), and will handle the "shutdown affects all clients" case?

Comment 2

a year ago
DataStorage right now in a tri-singleton (as in there's only 3 instances of it) if I'm reading the code correctly, so I don't think that's worth it...
Priority: -- → P3
Whiteboard: [psm-backlog]
You need to log in before you can comment on or make changes to this bug.