Thread: Thread-safe singleton.

  1. #1
    Registered User
    Join Date
    Oct 2003

    Thread-safe singleton.

    Hello, I'm currently trying to do some time multi-threaded cross-platform application with multiple cores. I need to use some high performance singletons but I haven't been able to find a good thread-safe singleton. Many people suggest using a double-checked locking singleton but I have found a paper which shows why that solution isn't reliable. Is there any high performance thread-safe singleton I can use or am I better just storing the pointer returned by singleton in each thread?


  2. #2
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    I remember this article mentioning something thready, but it might not be of any use, just thought I'd throw it at you while I've got a second
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

  3. #3
    Registered User
    Join Date
    Oct 2003
    That solution isn't thread-safe, thanks anyway.

  4. #4
    Registered User
    Join Date
    Nov 2001
    consider loki

    more better libraries remain private


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. thread safe in my code to manipulate List?
    By George2 in forum C# Programming
    Replies: 8
    Last Post: 05-01-2008, 06:57 AM
  2. are winsock functions thread safe?
    By *DEAD* in forum Networking/Device Communication
    Replies: 2
    Last Post: 12-15-2007, 10:37 AM
  3. Replies: 2
    Last Post: 07-01-2007, 07:11 AM
  4. Calling a Thread with a Function Pointer.
    By ScrollMaster in forum Windows Programming
    Replies: 6
    Last Post: 06-10-2006, 08:56 AM
  5. C++ Threading?
    By draggy in forum C++ Programming
    Replies: 5
    Last Post: 08-16-2005, 12:16 PM