Monitor Object

Learn about the monitor object pattern.

We'll cover the following...

Introduction

The monitor object synchronizes access to an object by limiting access to it. According to the monitor object patterns, the object should be accessed only by one client at any point in time. Each object will have a:

  • Monitor lock: This guarantees that only one client can execute a member function of the object.
  • Monitor condition: This notifies the waiting clients.

UML diagram

Let’s have a look at the monitor pattern’s UML diagram.

Monitor Object Uml Diagram
Monitor Object Uml Diagram

Participants

...