Design Patterns Singleton Midterm

Card Set Information

Author:
djon
ID:
263054
Filename:
Design Patterns Singleton Midterm
Updated:
2014-02-20 20:58:36
Tags:
Singleton midterm
Folders:

Description:
midterm
Show Answers:

Home > Flashcards > Print Preview

The flashcards below were created by user djon on FreezingBlue Flashcards. What would you like to do?


  1. getInstance
    clients access a Singleton instance solely through getInstance
  2. DCLP
    • Double Check Locking Pattern
    • 1.Check if it needs modification
    • 2.LockĀ 
    • 3.Check again
    • 4.If needs modification again - do so
    • 5.Unlock
  3. What happens if the thread switch occurs between the allocation and the initialization?
    the other thread could start using the singleton object before the initialization has completed.
  4. Compiler Memory Barriers
    • prevent compiler from reordering code
    • doesn't stop CPU from reordering
    • prior to 2005
  5. Hardware Memory Barriers
    • prevent CPU from reordering
    • combined with compiler memory barriers
    • since 2005, compiler/CPU barrier are used
  6. memory barriers
    used to force one process to complete its operation before another process can act on that variable

What would you like to do?

Home > Flashcards > Print Preview