Reputation: 8480
I'm writing to Azure Table storage using Storage SDK 2.0 from different threads (ASP.NET application).
Is CloudTable object thread-safe? Can I initialize CloudStorageAccount, CloudTableClient and CloudTable only once (for example, in static constuctor) and then use them in different threads?
Or is it better to create all CloudStorageAccount, CloudTableClient and CloudTable objects each time from a blank (like it's shown in this article)? Does it affect the performance in any way?
What is a prefered way of getting instance of CloudTable each time executing an operation against the table?
Upvotes: 24
Views: 5541
Reputation: 71
Upvotes: 7
Reputation: 5357
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Upvotes: 13