When.com Web Search

Search results

  1. Results From The WOW.Com Content Network
  2. Singleton pattern - Wikipedia

    en.wikipedia.org/wiki/Singleton_pattern

    A singleton implementation may use lazy initialization in which the instance is created when the static method is first invoked. In multithreaded programs, this can cause race conditions that result in the creation of multiple instances. The following Java 5+ example [6] is a thread-safe implementation, using lazy initialization with double ...

  3. Double-checked locking - Wikipedia

    en.wikipedia.org/wiki/Double-checked_locking

    There are valid forms of the pattern, including the use of the volatile keyword in Java and explicit memory barriers in C++. [4] The pattern is typically used to reduce locking overhead when implementing "lazy initialization" in a multi-threaded environment, especially as part of the Singleton pattern. Lazy initialization avoids initializing a ...

  4. Thread safety - Wikipedia

    en.wikipedia.org/wiki/Thread_safety

    Thread safe, MT-safe: Use a mutex for every single resource to guarantee the thread to be free of race conditions when those resources are accessed by multiple threads simultaneously. Thread safety guarantees usually also include design steps to prevent or limit the risk of different forms of deadlocks , as well as optimizations to maximize ...

  5. Software design pattern - Wikipedia

    en.wikipedia.org/wiki/Software_design_pattern

    Thread pool: A number of threads are created to perform a number of tasks, which are usually organized in a queue. Typically, there are many more tasks than threads. Can be considered a special case of the object pool pattern. No — Thread-specific storage: Static or "global" memory local to a thread. Yes — Safe Concurrency with Exclusive ...

  6. Constructor (object-oriented programming) - Wikipedia

    en.wikipedia.org/wiki/Constructor_(object...

    Static constructors are thread safe and implement a singleton pattern. When used in a generic programming class, static constructors are called at every new generic instantiation one per type. [ 8 ] : 38 [ 4 ] : 111 Static variables are instantiated as well.

  7. Concurrent hash table - Wikipedia

    en.wikipedia.org/wiki/Concurrent_hash_table

    Junction provides several implementations of concurrent hash tables for C++ on the basis of atomic operations to ensure thread-safety for any given member function of the table. The library is available on GitHub.

  8. Talk:Singleton pattern - Wikipedia

    en.wikipedia.org/wiki/Talk:Singleton_pattern

    In the thread-safe C++ example the single instance is allocated with new. I do not see how the destructor would ever be called. Shouldn't the example us an auto_ptr or equivilant? —The preceding JohnCFemiani 15:45, 7 December 2006 (UTC) Done; thanks for catching that. I'm thinking that perhaps we should get rid of the C++ examples altogether.

  9. Multiton pattern - Wikipedia

    en.wikipedia.org/wiki/Multiton_pattern

    Whereas the singleton allows only one instance of a class to be created, the multiton pattern allows for the controlled creation of multiple instances, which it manages through the use of a map. Rather than having a single instance per application (e.g. the java.lang.Runtime object in the Java programming language ) the multiton pattern instead ...