monitor
C# producer/consumer
The code is older than that – I wrote it some time before .NET 2.0 came out. The concept of a producer/consumer queue is way older than that though 🙂 Yes, that code is safe as far as I’m aware – but it has some deficiencies: It’s non-generic. A modern version would certainly be generic. … Read more
Is using a widescreen monitor in portrait orientation more effective for coding? [closed]
I actually have 3 widescreen monitors in portrait mode and yes, it’s a fantastic way to work. There’s so much less scrolling around and you can fit all your debug / output / reference windows on screen at once. The problem with using two monitors is that you’ll generally be working on one main one … Read more
Find Number and resolution to all monitors
In C#: Screen Class Represents a display device or multiple display devices on a single system. You want the Bounds attribute. foreach(var screen in Screen.AllScreens) { // For each screen, add the screen properties to a list box. listBox1.Items.Add(“Device Name: ” + screen.DeviceName); listBox1.Items.Add(“Bounds: ” + screen.Bounds.ToString()); listBox1.Items.Add(“Type: ” + screen.GetType().ToString()); listBox1.Items.Add(“Working Area: ” + … Read more
Lock (Monitor) internal implementation in .NET
The Wikipedia article has a pretty good description of what a “Monitor” is, as well as its underlying technology, the Condition Variable. Note that the .NET Monitor is a correct implementation of a condition variable; most published Win32 implementations of CVs are incorrect, even ones found in normally reputable sources such as Dr. Dobbs. This … Read more
Is a glossy or matte LCD screen better for long coding sessions? [closed]
Matte, because you get fewer reflections on it, which is good if your workplace is bright. I’ve worked with both, but especially if you have bright objects around your monitor, or windows at the side, you’ll really want to have a matte one. Constantly having reflections in it is really annoying, and hurts the readability … Read more
Can anyone explain thread monitors and wait?
Lots of good answers here already. But just want to mention here that the other MUST DO when using wait() is to do it in a loop dependent on the condition you are waiting for in case you are seeing spurious wakeups, which in my experience do happen. To wait for some other thread to … Read more
Monitor vs lock
Eric Lippert talks about this in his blog: Locks and exceptions do not mix The equivalent code differs between C# 4.0 and earlier versions. In C# 4.0 it is: bool lockWasTaken = false; var temp = obj; try { Monitor.Enter(temp, ref lockWasTaken); { body } } finally { if (lockWasTaken) Monitor.Exit(temp); } It relies on … Read more
Monitoring application calls to DLL
A “static” solution (in the sense it can capture a stack trace on demand) would be Process Monitor. A more dynamic solution would be ApiMonitor, but it may be too old to be compatible with the applications to monitor. Worth a try though.
Visual Studio and dual/multiple monitors: how do I get optimized use out of my monitors? [closed]
have one tab of code open on one monitor and a second tab of code open on the second monitor with only one instance of Visual Studio running you can simply drag a Tab outside of VS onto your other screen.