Closed Bug 1100758 Opened 10 years ago Closed 10 years ago

(ios) Create a general locking api

Categories

(Firefox for iOS :: General, defect)

All
iOS 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: wesj, Unassigned)

Details

Attachments

(1 file)

46 bytes, text/x-github-pull-request
Details | Review
Swift doesn't really have a nice locking API. We should write one. http://www.bignerdranch.com/blog/locking-in-swift-helping-protect-me-from-myself/ has a nice example one.
Group: mozilla-employee-confidential
Attached file Pull request
Attachment #8524317 - Flags: review?(bnicholson)
I'm not against having this but I think we need to try to avoid using special Locking as much as possible. In general you are either on the Main thread or on the UI thread. Operations should generally happen on the main thread. Or if they can take a while on one of the predefined queues that the system gives us. The main thread executes blocks serially, so if we are consistent and schedule work there, then there should mostly be no need for locking resources.
Comment on attachment 8524317 [details] [review]
Pull request

Yeah, Wes and I have been talking about threading in Swift over the past couple days, and I think we agree that we should be breaking up critical sections into tasks that are handed off to GCD.

I think we'll be dropping this and updating bug 8524345 to use GCD, so removing review.
Attachment #8524317 - Flags: review?(bnicholson)
(In reply to Brian Nicholson (:bnicholson) from comment #3)
> I think we'll be dropping this and updating bug 8524345 to use GCD, so
> removing review.

Oops, I copied the attachment # instead of the bug #. I meant bug 1094317.
I talked to brian about this again today for a bit. I like having a locking API TBH, but I'd like to sit down at the work week and look at other better solutions.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Group: mozilla-employee-confidential
OS: All → iOS 7
Product: Firefox for Android → Firefox for iOS
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: