SlideShare a Scribd company logo
Monitor Object

          charsyam@naver.com
Multiple Threads
Multiple Threads
          Shared Object
Thread-Safe
Passive-Object
Thread-Safe
         Passive-Object
Pattern
Active Object
 THREAD 1       THREAD 2
                     Processor
   Caller       ITEM 1
                ITEM 1
                ITEM 1
Active Object

 Caller Thread
            other-Threads
 Process Thread
Passive Object
 THREAD 1            THREAD 2
Processor              Processor
            ITEM 1
            ITEM 1
            ITEM 1
Passive Object

 Each Thread Process
          Shared Object
Active Object
          VS
         Monitor Object
Active Object
          VS
         Monitor Object
Monitor Object is
Monitor Object is
  Part Of Active Object
EXAMPLE
QUEUE
IN
Multi-Thread
NEED
Synchronization
  Mechanisms
THREAD 1   ITEM 1   THREAD 2
           ITEM 2
           ITEM 3
           ITEM 4
           ITEM 5
THREAD 1      ITEM 1   THREAD 2
              ITEM 2
     INSERT
              ITEM 3
              ITEM 4
              ITEM 5
THREAD 1      ITEM 1   THREAD 2
              ITEM 2
     INSERT
              ITEM 3   INSERT


              ITEM 4
              ITEM 5
THREAD 1      ITEM 1   THREAD 2
              ITEM 2
     INSERT
              ITEM 3   INSERT


              ITEM 4
              ITEM 5

                 BROKEN
No Item
   In
 Queue
THREAD 1              THREAD 2

     Pop


           No Items
THREAD 1              THREAD 2

     Pop


           No Items
WAIT
THREAD 1   ITEM 1   THREAD 2
                     Insert

     Pop




WAIT
THREAD 1   ITEM 1   THREAD 2
                     Insert

     Pop




NOTIFY
THREAD 1   ITEM 1   THREAD 2
     Pop
Monitor
 Object
Monitor object
Monitor object
With
Thread-Safe
 Interface
External Interface
Thread-Safe Interface
Lock and Notify – 1/2
Lock and Notify – 2/2
Lock and Notify – 2/2
Empty and Full
put
Get
SYNCH_STRATEGY 1/2
SYNCH_STRATEGY 2/2
Connection
   Pool
Multi-Thread
   Queue
Benefits
Simplification of concurrency control
Simplification of scheduling method
execution
Benefits
Simplification of concurrency control
Simplification of scheduling method
execution
Liabilities
Complicated extensibility of coupling
with Monitor Object’s
Inheritance anomaly
Nested Monitor Lockout
Liabilities
Complicated extensibility of coupling
with Monitor Object’s
Inheritance anomaly
Nested Monitor Lockout
Liabilities
Complicated extensibility of coupling
with Monitor Object’s
Inheritance anomaly
Nested Monitor Lockout
THANK
 YOU!

More Related Content

PPTX
Cutting edge android stack. One year later
PDF
Categorical Quantum Computing
PDF
Gae users service
PDF
Command processor
PDF
Clean code pm
PDF
Gae datastore
PDF
Server modeling with mysql
PDF
Whole part
Cutting edge android stack. One year later
Categorical Quantum Computing
Gae users service
Command processor
Clean code pm
Gae datastore
Server modeling with mysql
Whole part

Viewers also liked (6)

PDF
Proactor
PDF
Process
PDF
Publisher subscriber pattern
PDF
Scalable
PDF
Gearman
PDF
Refactoring(inline class, Hide delegate, remove middle man)
Proactor
Process
Publisher subscriber pattern
Scalable
Gearman
Refactoring(inline class, Hide delegate, remove middle man)
Ad

Similar to Monitor object (20)

PPTX
multithreading.pptx
PPTX
Interactions complicate debugging
PDF
CS844 U1 Individual Project
PPTX
Threading through InterBase, Firebird, and beyond
PPTX
Java class 6
PDF
Other Approaches (Concurrency)
PDF
Concurrency
PDF
Actors, a Unifying Pattern for Scalable Concurrency | C4 2006
ODP
Multithreading 101
PPT
Google: Cluster computing and MapReduce: Introduction to Distributed System D...
PDF
Module 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModul...
PPTX
Multithreading
PDF
Sync, async and multithreading
PPTX
Full solution to bounded buffer
PPT
Threads in Java
PPTX
Parallel Processing (Part 2)
ODP
Concept of thread
PDF
Need for Async: Hot pursuit for scalable applications
PPT
T01520010220104023 t0152 pert 10
PDF
CS9222 ADVANCED OPERATING SYSTEMS
multithreading.pptx
Interactions complicate debugging
CS844 U1 Individual Project
Threading through InterBase, Firebird, and beyond
Java class 6
Other Approaches (Concurrency)
Concurrency
Actors, a Unifying Pattern for Scalable Concurrency | C4 2006
Multithreading 101
Google: Cluster computing and MapReduce: Introduction to Distributed System D...
Module 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModul...
Multithreading
Sync, async and multithreading
Full solution to bounded buffer
Threads in Java
Parallel Processing (Part 2)
Concept of thread
Need for Async: Hot pursuit for scalable applications
T01520010220104023 t0152 pert 10
CS9222 ADVANCED OPERATING SYSTEMS
Ad

More from DaeMyung Kang (20)

PPTX
Count min sketch
PDF
PDF
Ansible
PDF
Why GUID is needed
PDF
How to use redis well
PPTX
The easiest consistent hashing
PDF
How to name a cache key
PDF
Integration between Filebeat and logstash
PDF
How to build massive service for advance
PDF
Massive service basic
PDF
Data Engineering 101
PDF
How To Become Better Engineer
PPTX
Kafka timestamp offset_final
PPTX
Kafka timestamp offset
PPTX
Data pipeline and data lake
PDF
Redis acl
PDF
Coffee store
PDF
Scalable webservice
PDF
Number system
PDF
webservice scaling for newbie
Count min sketch
Ansible
Why GUID is needed
How to use redis well
The easiest consistent hashing
How to name a cache key
Integration between Filebeat and logstash
How to build massive service for advance
Massive service basic
Data Engineering 101
How To Become Better Engineer
Kafka timestamp offset_final
Kafka timestamp offset
Data pipeline and data lake
Redis acl
Coffee store
Scalable webservice
Number system
webservice scaling for newbie

Monitor object