是Azure的CloudTable线程安全的?线程、安全、Azure、CloudTable

2023-09-04 02:04:32 作者:哥、人见人碍

我使用的存储SDK 2.0,从不同的线程(ASP.NET应用程序)写的Azure表存储。

I'm writing to Azure Table storage using Storage SDK 2.0 from different threads (ASP.NET application).

是 CloudTable 对象的线程安全?可以予初始化CloudStorageAccount,CloudTableClient和CloudTable只有一次(例如,在静态constuctor),然后使用它们在不同的线程?

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?

或者是更好地创造一切CloudStorageAccount,CloudTableClient和CloudTable对象,每一次从空白(像它的显示在的这篇文章)?这是否会影响性能以任何方式?

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?

什么是越来越CloudTable的情况下执行的操作对表中的每个时间的prefered方式?的

推荐答案

CloudStorageAccount

任何公共static(在Visual Basic中的Shared)这种类型的成员   线程安全的。所有实例成员都不能保证是线程   安全的。

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

CloudTableClient

任何公共static(在Visual Basic中的Shared)这种类型的成员   线程安全的。所有实例成员都不能保证是线程   安全的。

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.