Monitor object

1,689 views

Published on

Monitor object

  1. 1. Monitor Object charsyam@naver.com
  2. 2. Multiple Threads
  3. 3. Multiple Threads Shared Object
  4. 4. Thread-Safe
  5. 5. Passive-Object
  6. 6. Thread-Safe Passive-ObjectPattern
  7. 7. Active Object THREAD 1 THREAD 2 Processor Caller ITEM 1 ITEM 1 ITEM 1
  8. 8. Active Object Caller Thread other-Threads Process Thread
  9. 9. Passive Object THREAD 1 THREAD 2Processor Processor ITEM 1 ITEM 1 ITEM 1
  10. 10. Passive Object Each Thread Process Shared Object
  11. 11. Active Object VS Monitor Object
  12. 12. Active Object VS Monitor Object
  13. 13. Monitor Object is
  14. 14. Monitor Object is Part Of Active Object
  15. 15. EXAMPLE
  16. 16. QUEUE
  17. 17. INMulti-Thread
  18. 18. NEEDSynchronization Mechanisms
  19. 19. THREAD 1 ITEM 1 THREAD 2 ITEM 2 ITEM 3 ITEM 4 ITEM 5
  20. 20. THREAD 1 ITEM 1 THREAD 2 ITEM 2 INSERT ITEM 3 ITEM 4 ITEM 5
  21. 21. THREAD 1 ITEM 1 THREAD 2 ITEM 2 INSERT ITEM 3 INSERT ITEM 4 ITEM 5
  22. 22. THREAD 1 ITEM 1 THREAD 2 ITEM 2 INSERT ITEM 3 INSERT ITEM 4 ITEM 5 BROKEN
  23. 23. No Item In Queue
  24. 24. THREAD 1 THREAD 2 Pop No Items
  25. 25. THREAD 1 THREAD 2 Pop No ItemsWAIT
  26. 26. THREAD 1 ITEM 1 THREAD 2 Insert PopWAIT
  27. 27. THREAD 1 ITEM 1 THREAD 2 Insert PopNOTIFY
  28. 28. THREAD 1 ITEM 1 THREAD 2 Pop
  29. 29. Monitor Object
  30. 30. WithThread-Safe Interface
  31. 31. External Interface
  32. 32. Thread-Safe Interface
  33. 33. Lock and Notify – 1/2
  34. 34. Lock and Notify – 2/2
  35. 35. Lock and Notify – 2/2
  36. 36. Empty and Full
  37. 37. put
  38. 38. Get
  39. 39. SYNCH_STRATEGY 1/2
  40. 40. SYNCH_STRATEGY 2/2
  41. 41. Connection Pool
  42. 42. Multi-Thread Queue
  43. 43. BenefitsSimplification of concurrency controlSimplification of scheduling methodexecution
  44. 44. BenefitsSimplification of concurrency controlSimplification of scheduling methodexecution
  45. 45. LiabilitiesComplicated extensibility of couplingwith Monitor Object’sInheritance anomalyNested Monitor Lockout
  46. 46. LiabilitiesComplicated extensibility of couplingwith Monitor Object’sInheritance anomalyNested Monitor Lockout
  47. 47. LiabilitiesComplicated extensibility of couplingwith Monitor Object’sInheritance anomalyNested Monitor Lockout
  48. 48. THANK YOU!

×