Swift doesn't seem to have any queues or other threading mechanisms?

I have a timer function (GCD) which is periodically consuming data from one end of an array. And the main thread wants to add data to the end of the array. Basically a queue. What's the idiomatic way to make sure everything is thread savvy/safe in Swift?

(Aside is it ok to ask Swift in the context of iOS questions here? Or is there a better place to ask those?)

Probably the most idiomatic way in GCD would be to dispatch from the main queue to the queue that “owns” the array. But if you have lots of threads reading and writing to the array you probably want to use a semaphore.