Closed Bug 1325178 Opened 7 years ago Closed 4 years ago

Share a single worker across all DataStorage instances

Categories

(Core :: Security: PSM, defect, P3)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1470918

People

(Reporter: ehsan.akhgari, Unassigned)

Details

(Whiteboard: [psm-backlog])

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?
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]
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.