We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Mark R.5
9 years agoHelpful | Level 5
Objective-C V2 SDK thread safety
I am just in the middle of implementing a syncing solution using the Obj-C V2 SDK.
I have a couple of concurrent threads. One for checking for (and downloading) any remote changes, and another ...
Mark R.5
9 years agoHelpful | Level 5
Hi. Thanks for the response.
I will create a new serial queue and make sure all API calls are dispatched to this queue for the time being. It is not a massive issue since it is relatively easy to workaround using GCD, but it does start to get a bit messy. In my case I want to maintain two separate concurrent threads, one for downloads and one for uploads. Now I also have to offload to a serial queue for the API calls, while keeping the rest of the sync logic on the concurrent queue. This means that I need to add code to wait for the API calls to return. I can do this using a dispatch_semaphore_t and waiting on the callback to complete, but this does start to become difficult to manage the more calls you have. Personally I would rather not have to worry about this and be able to make API calls from any thread.
On a related note, I am also implementing this syncing solution using the dot-net sdk. This is different in that the API methods are generally async and you await them, so evertthing is effectively handled inline on the same thread. Does this framework also have potential thread safety issues, since I have a similar design with two concurrent threads making API calls...
Stephen C.14
Dropbox Staff
9 years agoThanks for letting me know. I looked into making the Obj-C SDK threadsafe, and I actually don't think it will require much work on my end, so I'll go ahead and do that, and put out a new version later today. If you wouldn't mind, try it out, and see if you run into any threading issues. I'm pretty sure I accounted for everything, but all the same, it would be helpful testing it with your use case.
.NET SDK is threadsafe, so no worries there.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!