摘要
线程使应用分成多个单元执行,在分布式中,实际上使用一个多线程的体系。这些线程之一可能会执行一个ASP.NET页面,该页面会调用组件服务中的一个。由于操作系统要跟踪和确定线程的进度,线程的系统开销会比较大,因此不应该在任何地方都创建新的线程。创建和维护线程的基类是Thread。大部分的Thread成员都是虚成员,只可以由一个特定Thread类的实例访问。为了启动一个新的线程,必须指定一个入口。对资源的同步访问提出了建议。为了确保某线程在访问这些资源时其他线程处于等待状态,可以使用Monitor类和它的相关方法,要使同步线程间共享实例变量,可以使用Interlocket类。
The application divided many units when using multi-thread process, in distributed operating system there's multi-thread process system in use actually. One of these thread processes may apply one ASP.NET page which use one of the module severs. Because OS keeps up with and determine the progress of the thread process, the expenditure of thread process system will be great. Thus we can't establish new thread process anywhere. The base type of establishing and maintaining is Thread. Most members of Thread are virtual one. Thus access is by a specific Thread example. In order to run a new thread process an entrance must be pointed. Suggestion is put forward for the synchronous access of resources. In order to ensure the waiting condition of other thread process when one is visiting these resources, the monitor and its related methods can by used. In order to synchronize the variants between the shared examples among thread process, Interlocket can by used.
出处
《抚顺石油学院学报》
2003年第3期65-68,共4页
Journal of Fushun Petroleum Institute