锁,监视器,互斥

编程入门 行业动态 更新时间:2024-10-22 14:24:31
本文介绍了锁,监视器,互斥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

可能重复:结果的监控VS互斥锁在C#

在这个网站,我发现从不同的人,这使得不同的混淆不同的答案。还是根本就不清楚究竟哪些情况下每三个方面[锁定,显示器,互斥]的将是实时需求非常有用的。 ,使这些条款之间更加混乱。

In this site i found different different answers from different people which makes confusing. still not at all clear exactly on which scenario each of the three terms [Lock,Monitor,Mutex] will be very useful for the realtime need. Makes much more confusion between these terms.

我需要在高水平,在深度和广度上非常明显的差异实质上是要求每个中使用三个学期有更好的例子和清晰的认识。

I would require very clear differences in High level-in depth and which is essentially required to use among each of the three terms with better example and with clear understanding.

请提供在非常高的水平实时使用情况的信息或需要使用C#.NET具有非常好的例子。

Kindly provide the info at the very high level of realtime usage or need using C#.NET with very good example.

由于 Sukumar

Thanks Sukumar

推荐答案

简体中文,简称:

A 显示器是管理.NET同步原语(范围只有一个应用程序域)。 C#的锁()什么也不做,但使用显示器和尝试......最后子句,以确保该锁是在异常的情况下释放。

A Monitor is the managed .NET synchronization primitive (scope is one application domain only). The C# lock() does nothing but use Monitor and a try...finally clause to make sure that the lock is released in the case of an exception.

一个互斥是一个OS同步对象,这也可以使用跨多个进程(通过命名的互斥体)同步。

A Mutex is an OS synchronization object, which can also be used to synchronize across multiple processes (via named mutex).

更多推荐

锁,监视器,互斥

本文发布于:2023-11-11 06:14:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1577598.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:监视器   互斥

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!