appfabric的并发性和线程安全性 [英] concurrency and thread safety with appfabric

查看:111
本文介绍了appfabric的并发性和线程安全性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用以下方法使用appfabirc缓存与缓存进行交互:


获取,放置,删除


我正在使用拥有众多用户的ac#应用程序,因此我关注并发性和线程安全性。我有一个锁定机制,在与缓存交互时使用锁定对象,例如。


lock(object)


{


//缓存交互


}


我想知道这是必需的还是appfabric处理线程的安全性和并发性?对此的任何帮助都会很棒。


解决方案

App Fabric Cache有2个并发模型:


1。乐观并发模型


2。悲观并发模型


您可以在此处阅读有关这些并发模型的更多信息 -   http://msdn.microsoft.com/en-us/library/ee790890.aspx


您还可以在 -   http://msdn.microsoft.com/en-us/library/hh351387.aspx

I am currently working with appfabirc caching using the following methods to interact with the cache:

Get, Put, Remove

I am working with a c# application that have numerous users therefore I am concerned with concurrency and thread safety. I had in place a locking mechanism that uses a locking object when interacting with the cache eg.

lock (object)

{

// cache interaction

}

I am wondering is this required or does appfabric handle thread safety and concurrency? Any assistance with this would be great.

解决方案

App Fabric Cache has 2 concurrency models:

1. Optimistic Concurrency Model

2. Pessimistic Concurrency Model

You can read more about these concurrency models here - http://msdn.microsoft.com/en-us/library/ee790890.aspx

You can also read about concurrenty methods at - http://msdn.microsoft.com/en-us/library/hh351387.aspx


这篇关于appfabric的并发性和线程安全性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆