Destruction-Managed Singleton: a compound pattern for reliable deallocation of singletons

نویسنده

  • Evgeniy Gabrilovich
چکیده

Singleton [1] is a creational pattern with well-defined semantics ensuring that the instance is always created prior to use. This effectively solves the problem of initialization order when a number of interrelated objects are involved. But the pattern’s destruction semantics is inadequate for several singletons with complex dependencies among them. A Destruction-Managed Singleton complements this pattern by imposing a sound order of object destruction. Destruction-Managed Singleton is an instance of the Object Lifetime Manager pattern [2], which “governs the entire lifetime of objects, from creating them prior to their first use, to ensuring they are destroyed properly at program termination”.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

The development of children’s problem behaviors: a twin-singleton comparison and the influence of parental divorce

Background: Research on twin-singleton differences in externalizing and internalizing problems in childhood is largely cross-sectional and yields contrasting results. The goal of this study was to compare developmental trajectories of externalizing and internalizing problems in 6to 12-year-old twins and singletons. Methods: Child Behavior Checklist maternal reports of externalizing and internal...

متن کامل

Controlling the Destruction Order of Singleton Objects

Abstract The Singleton pattern [1] is a solution to (some of) the drawbacks of using global variables. Among its advantages is that the instance is always created prior to being referenced (this effectively solves the problem of initialization order when several interdependent instances are involved). This article examines some of the existing Singleton realizations in C++ and their drawbacks, ...

متن کامل

Timing of Second Language Singletons and Geminates

This study investigated the realization of Italian geminate-singleton contrasts by naïve and advanced L2 speakers of Italian whose L1 was German, a language with no consonantal length contrasts. We show that geminate-singleton differences could be established by all groups although there were significant differences in the geminate-singleton duration ratios across groups (Italian > advanced lea...

متن کامل

Problems, Workarounds and Possible Solutions Implementing the Singleton Pattern with C++ and OpenMP

Programs written in C++ and OpenMP are still relatively rare. This paper shows some problems with the current state of the OpenMP specification regarding C++. We illustrate the problems with various implementations of the singleton pattern, measure their performance and describe workarounds and possible changes to the specification. The singletons are available in the AthenaMP open-source project.

متن کامل

Masked singleton effects.

In the present study, we tested whether visual singletons remaining outside awareness are processed. Singletons differ by at least one feature from their more homogeneous neighbors. Here, we used backward masking to prevent awareness of shape singleton primes (Experiments 1-4) or color singleton primes (Experiment 5). Masked singleton primes nonetheless produced a congruence effect: Congruent s...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2000