Questions tagged [monitor]

Monitor is component for Monitoring. It is the act of looking on the processes or systems for performance, supervision and surveillance.

1485 questions
271
votes
7 answers

Semaphore vs. Monitors - what's the difference?

What are the major differences between a Monitor and a Semaphore?
user919860
  • 3,083
  • 4
  • 19
  • 16
201
votes
19 answers

How can I monitor the thread count of a process on linux?

I would like to monitor the number of threads used by a specific process on Linux. Is there an easy way to get this information without impacting the performance of the process?
zorro_velcro
158
votes
6 answers

What's a monitor in Java?

What's a monitor referred to in concurrent programming in Java? When I read that "every object has associated a monitor" what does it meaning? Is it a special object?
xdevel2000
  • 20,780
  • 41
  • 129
  • 196
110
votes
9 answers

Monitor vs lock

When is it appropriate to use either the Monitor class or the lock keyword for thread safety in C#? EDIT: It seems from the answers so far that lock is short hand for a series of calls to the Monitor class. What exactly is the lock call short-hand…
smartcaveman
  • 41,281
  • 29
  • 127
  • 212
99
votes
6 answers

What's the meaning of an object's monitor in Java? Why use this word?

When reading articles about Java threads, I often notice the expression: "current thread is the owner of this object's monitor". I get the meaning: the thread gets the right to operate on the object. But I am puzzled why we use the phrase "the…
jiafu
  • 6,338
  • 12
  • 49
  • 73
53
votes
3 answers

Monitor vs Mutex

I read that mutex is a semaphore with value 1 (binary semaphore) used to enforce mutual exclusion. I read this link Semaphore vs. Monitors - what's the difference? which says that monitor helps in achieving mutual exclusion. Can someone tell me the…
Zephyr
  • 1,521
  • 3
  • 22
  • 42
50
votes
4 answers

Is it ok to read a shared boolean flag without locking it when another thread may set it (at most once)?

I would like my thread to shut down more gracefully so I am trying to implement a simple signalling mechanism. I don't think I want a fully event-driven thread so I have a worker with a method to graceully stop it using a critical section Monitor…
John
  • 6,433
  • 7
  • 47
  • 82
48
votes
11 answers

Visual Studio and dual/multiple monitors: how do I get optimized use out of my monitors?

Ultramon is a great program for dual monitors (stretching screen across monitors), but I was wondering if there is any way do to something in Visual Studio like have one tab of code open on one monitor and a second tab of code open on the second…
Bryan Denny
  • 27,363
  • 32
  • 109
  • 125
44
votes
4 answers

Monitoring application calls to DLL

In short: I want to monitor selected calls from an application to a DLL. We have an old VB6 application for which we lost the source code (the company wasn't using source control back then..). This application uses a 3rd party DLL. I want to use…
kshahar
  • 10,423
  • 9
  • 49
  • 73
42
votes
6 answers

Can anyone explain thread monitors and wait?

Someone at work just asked for the reasoning behind having to wrap a wait inside a synchronized. Honestly I can't see the reasoning. I understand what the javadocs say--that the thread needs to be the owner of the object's monitor, but why? What…
Bill K
  • 62,186
  • 18
  • 105
  • 157
40
votes
2 answers

Lock (Monitor) internal implementation in .NET

For mastering of some technology you have to know how it's made at one abstraction level lower. In case of multithreading programming, it will be good to know about synchronization primitives. Here is the question, how implemented Lock (Monitor) in…
alexber
  • 647
  • 1
  • 5
  • 9
40
votes
6 answers

Is a glossy or matte LCD screen better for long coding sessions?

I'm looking at getting a new LCD monitor, but I'm concerned that a glossy monitor might cause more eye strain after a long day of work. I typically spend a lot of time in front of my monitor, so eye strain is definitely something I have thought…
Jon Tackabury
  • 47,710
  • 52
  • 130
  • 168
39
votes
3 answers

Find Number and resolution to all monitors

How would one poll windows to see what monitors are attached and what resolution they are running at?
Crash893
  • 11,428
  • 21
  • 88
  • 123
33
votes
17 answers

Is using a widescreen monitor in portrait orientation more effective for coding?

In the very near future my development setup will be upgraded and part of the deal will be dual monitors (yay!) At least one of the monitors, possibly both, will be widescreen. I've heard of developers using a second monitor, especially a widescreen…
Tom Kidd
  • 12,830
  • 19
  • 89
  • 128
32
votes
7 answers

C# producer/consumer

i've recently come across a producer/consumer pattern c# implementation. it's very simple and (for me at least) very elegant. it seems to have been devised around 2006, so i was wondering if this implementation is - safe - still applicable Code is…
lboregard
  • 329
  • 1
  • 4
  • 3
1
2 3
98 99