系统.运行时.远程处理 [英] System.Runtime.Remoting abouut
本文介绍了系统.运行时.远程处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<configuration>
<system.runtime.remoting>
<application>
<service>
<wellknown type="ONX.Cmn.MyService, ONXCmn">
objectUri="MyServiceUri"
mode="Singleton"
</wellknown></service>
<channels>
<channel ref="tcp" port="33000" />
</channels>
</application>
</system.runtime.remoting>
</configuration>
在此代码中(mode = Singleton),如果同时有100个以上的客户端连接到Server,并调用相同的功能(此功能从数据库中获取数据),客户的数据是否会交叉或混合?
[edit]添加了代码块,转义了XML字符,因此我们可以实际读取它们...-OriginalGriff [/edit]
in this code(mode=Singleton) ,if same time more 100 client connect to Server ,and call same function (this function fetch data from database) ,will clien''s datas cross or mixed ?
[edit]Code block added, XML characters escaped so we can actually read them... - OriginalGriff[/edit]
推荐答案
取决于函数的设计,即它们的线程安全性".使用lock
语句可以防止数据与并发线程的破坏性交互.
Depends on the design of your functions, i.e. their "thread safety". Use lock
statements to safeguard data from destructive interaction of concurrent threads.
这篇关于系统.运行时.远程处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文