Closed
Bug 1226406
Opened 10 years ago
Closed 10 years ago
Allow transactions and database operations to be performed without blocking the calling thread
Categories
(Firefox for iOS :: Data Storage, defect)
Tracking
()
RESOLVED
FIXED
2.0
People
(Reporter: rnewman, Assigned: rnewman)
References
Details
Attachments
(1 file)
This is a little bit of a fork of Bug 1189170.
The current SwiftData withConnection and transaction calls, and their wrappers in BrowserDB, are the worst kind of async -- they block two threads at once!
We call dispatch_sync to hand a block over to the connection's queue.
That means we wait for the current queue contents to finish running, run the block, and then finally return from the caller.
And very often what we do after that is return a Deferred or invoke some UI callback.
In those cases, there's really no reason to use dispatch_sync; we can have the callback do the right thing, such as filling the Deferred. The calling code can roll right on and do what it likes, chaining off the Deferred if it needs the result.
| Assignee | ||
Comment 1•10 years ago
|
||
Attachment #8689781 -
Flags: review?(sleroux)
Attachment #8689781 -
Flags: review?(bnicholson)
Comment 2•10 years ago
|
||
Comment on attachment 8689781 [details] [review]
Link to Github pull-request: https://github.com/mozilla/firefox-ios/pull/1284
Makes sense, though I noticed you aren't actually using synchronous = false anywhere. Just groundwork for bug 1189170?
Attachment #8689781 -
Flags: review?(bnicholson) → review+
| Assignee | ||
Comment 3•10 years ago
|
||
| Assignee | ||
Comment 4•10 years ago
|
||
0824db3
| Assignee | ||
Updated•10 years ago
|
Blocks: 1201110
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.0
Updated•10 years ago
|
Attachment #8689781 -
Flags: review?(sleroux)
You need to log in
before you can comment on or make changes to this bug.
Description
•