本文介绍了可以将Parallel.ForEach与CloudTableQuery安全使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Azure表中有相当数量的记录,试图对其进行一次数据加密.我以为可以使用Parallel.ForEach加快速度.另外,因为有超过1K的记录,而且我不想自己搞弄连续标记,所以我正在使用CloudTableQuery来获取我的枚举数.

I have a reasonable number of records in an Azure Table that I'm attempting to do some one time data encryption on. I thought that I could speed things up by using a Parallel.ForEach. Also because there are more than 1K records and I don't want to mess around with continuation tokens myself I'm using a CloudTableQuery to get my enumerator.

我的问题是我的某些记录已被双重加密,并且我意识到我不确定CloudTableQuery.Execute()返回的枚举数在线程上的安全性如何.还有其他人对此组合有经验吗?

My problem is that some of my records have been double encrypted and I realised that I'm not sure how thread safe the enumerator returned by CloudTableQuery.Execute() is. Has anyone else out there had any experience with this combination?

推荐答案

尽管尽我最大的努力,我仍然无法复制最初的问题.因此,我的结论是,将Parallel.ForEach循环与CloudTableQuery.Execute()一起使用是完全可以的.

Despite my best efforts I've been unable to replicate my original problem. My conclusion is therefore that it is perfectly OK to use Parallel.ForEach loops with CloudTableQuery.Execute().

这篇关于可以将Parallel.ForEach与CloudTableQuery安全使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 14:08