Is ACAccount thread safe?

Can I share a single ACAccount instance between threads? Specifically I would like to create multiple TWRequest objects that are used by different NSOperationQueue instances. Those TWRequest objects will share a single ACAccount instance. Is that safe?

Thanks.

Answers


I'm going to say, "no." Firstly, ACAccount does not appear on Apple's "Thread Safe" list. Secondly, I see no explicit mention of thread safety in the reference for either of those classes. Thirdly, I see that TWRequest appears to be built upon NSURLConnection which is designed for use on a run loop (typically the main thread). I see nothing at all to indicate that these classes are safe for concurrent use from multiple threads. At best, you should take a thread-confinement approach (i.e. each thread fetches/creates its own copies of these objects and should not pass them between threads.)

Since TWRequest is designed for cooperative/runloop-based operation, I see no reason that you would need to do this stuff on a background thread either, FWIW.

So yeah. I'd say, "no."


Need Your Help

Android: Passing parameters to Alert Dialog

android android-ui android-dialog

I am showing a simple Alert Dialog with OK/Cancel buttons.

VBA EXCEL- Comparing listbox item to cell value (string)

excel vba excel-vba excel-2007

My list box is on a form. When a user selected list items they are stored in a column. Later when m edit button is clicked I would like to read in these values and add them onto a selected list

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.