Questions tagged [monitors]

In concurrent programming, a monitor is an object or module intended to be used safely by more than one thread. The defining characteristic of a monitor is that its methods are executed with mutual exclusion.

Wikipedia Monitor(synchronization):

In concurrent programming, a monitor is an object or module intended to be used safely by more than one thread. The defining characteristic of a monitor is that its methods are executed with mutual exclusion. That is, at each point in time, at most one thread may be executing any of its methods. This mutual exclusion greatly simplifies reasoning about the implementation of monitors compared to reasoning about parallel code that updates a data structure.

Monitors also provide a mechanism for threads to temporarily give up exclusive access, in order to wait for some condition to be met, before regaining exclusive access and resuming their task. Monitors also have a mechanism for signaling other threads that such conditions have been met.

52 questions
14
votes
3 answers

How can I retrieve monitor information?

I am trying to retrieve the monitor ID's as shown in the Windows display properties (#1, 2... etc), but I can't seem to find a way. I have tried using EnumDisplayMonitors as well as EnumDisplayDevices. They both return something like "\.\DISPLAY1".…
Jon Tackabury
  • 47,710
  • 52
  • 130
  • 168
11
votes
4 answers

Running VNC fullscreen with multiple monitors

I'm connecting to a remote system using VNC (tigervnc-1.1.0 on client, RealVNC-4.1.2 on server). The client system has two monitors using Nvidia twinview, with an effective resolution of 3200x1200. When I tell vncviewer to use fullscreen, the…
Mike Eager
  • 309
  • 1
  • 2
  • 9
5
votes
1 answer

How can I change monitor settings to duplicate and extend via script

As I am using a laptop with a tv as its second monitor I want to make a little script which will trigger screen settings from extended to clone and when it is set to clone it should set the screen settings to extended. I want to make it in c# as it…
chrs
  • 5,906
  • 10
  • 43
  • 74
5
votes
1 answer

Java GUI Fullscreen for Multiple Screens

I hope I'm not posting a duplicate question, but I wasn't able to find a question like this so maybe I'm safe? Anyway... For the applications that I'm making, I'm going to have two applications (two separate processes and windows) open at the same…
Sephallia
  • 396
  • 2
  • 9
4
votes
1 answer

Synchronizing threads using condition variables (monitors)

I need to synchronize multiple threads (using POSIX threads). Moreover, I am making use of condition variables (monitors) to achieve that. The issue is that I must implement a "first come first served" strategy. Say multiple threads are waiting for…
Pure
  • 85
  • 1
  • 8
4
votes
2 answers

retrieve multiple display information using win32/C++

Is there any way to retrieve information about how many extra displays there are besides the main one, how they are numbered, what the dimensions are, etc? I know this is pretty easy in .net land.
user313644
  • 43
  • 1
  • 3
3
votes
1 answer

Monitoring a gen_server

I have been trying to monitor a gen_server using erlang:monitor/2. Unfortunately every time I try this the Erlang shell goes into an infinite loop. Here is the test program i've written to test this…
Brendan Cutajar
  • 697
  • 6
  • 14
3
votes
3 answers

Readers-writers with monitors - java

I am implementing readers writers problem with monitors in Java. There are many readers and writers. When a writer is writing, no other reader or writer can read or write. Many readers can read simultaneously. I don't know what's wrong with this…
parul
  • 31
  • 1
  • 3
3
votes
1 answer

Chrome stable and Chrome Canary use a different color profile (Mac OSX)

Below is a screenshot of the same hex code. Right is Canary and left is the stable version of Chrome. Canary uses a wrong color profile (I think), the bright version is the "wrong" one. Does anybody know how I can figure out where the problem is and…
Sten Van den Bergh
  • 1,565
  • 2
  • 13
  • 20
2
votes
2 answers

Mutexes vs Monitors - A Comparison

From what I have learned about Mutexes - they generally provide a locking capability on a shared resources. So if a new thread wants to access this locked shared resource - it either quits or has to continually poll the lock (and wastes processor…
Hari
  • 5,057
  • 9
  • 41
  • 51
2
votes
1 answer

HDMI TV sometimes not detected in windows 7? Possible to invoke Detect in code?

i have a standalone public kiosk pc that startups automatically everyday. It is connected to a HD TV and sometimes it is not detected. i have to personally go down to the PC, go to Screen Resolution and press Detect which it works. my question is…
icube
  • 2,578
  • 1
  • 30
  • 63
2
votes
1 answer

Passing monitor method as thread parameter c++

I'm coding a monitor to mutually exclude access to the methods of a std::list What I have now is basically this: list l; class monitor{ public: void m_add(int x){ //lock use of m_remove //lock use of m_add …
2
votes
1 answer

Determine if screen is active or not from Windows 8 Registry

I am looking at monitors list in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\DISPLAY In Windows 7, there are a subkey under each screen node named "Control" that indicate if the screen is active or not. In Windows 8 there are no such…
Yuri
  • 49
  • 3
2
votes
1 answer

Dual Monitor Screen Capture issue

I have dual monitors and I am working on a product that allows you to record your computer screen. Currently, I am using the following code: Rectangle screenArea = Rectangle.Empty; foreach (System.Windows.Forms.Screen screen in…
2
votes
1 answer

Monitor.Wait timeout never times out

So I have a simple test using Monitor.Wait with a timeout set for three seconds. It's my understanding that, when the time expires, a virtual pulse is sent to the monitor to release the wait. In my test, however, that never seems to happen. Can…
Hexum064
  • 349
  • 2
  • 14
1
2 3 4