What's the difference between a monitor and a lock?
If a lock is simply an implementation of mutual exclusion, then is a monitor simply a way of making use of the waiting time inbetween method executions?
A good explanation would be really helpful thanks....
regards
Televisions have a viewing angle of about 160 degrees. Since monitors have a higher resolution, the quality of images is very high-quality, accurate, and sharp. Since televisions have a lower resolution, the image quality is much smoother and appealing to the viewers' eyes. Monitors experience less input lag.
There are five types of monitors CRT(Cathode Ray tube), LCD (Liquid Crystal Display), LED (Liquid Emitting Diode), OLED (Organic Light Emitting Diode), and Plasma Monitor all are used in televisions or computer desktops.
Monitors usually have lower input lag, higher refresh rates and faster response time than TVs, which make them a better choice for gaming (there are exceptions, such as OLED TVs). On the other side, TVs are larger and more affordable, so they are fantastic for watching movies and TV shows, as well as console gaming.
For example in C# .NET a lock statement is equivalent to:
Monitor.Enter(object);
try
{
// Your code here...
}
finally
{
Monitor.Exit(object);
}
However, keep in mind that Monitor can also Wait()
and Pulse()
, which are often useful in complex multithreading situations.
Edit: In later versions of the .NET framework, this was changed to:
bool lockTaken = false;
try
{
Monitor.Enter(object, ref lockTaken);
// Your code here...
}
finally
{
if (lockTaken)
{
Monitor.Exit(object);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With