• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Singleton instances and multithreading
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Singleton instances and multithreading


  • Subject: Re: Singleton instances and multithreading
  • From: "Axel 'Mikesch' Katerbau" <email@hidden>
  • Date: Wed, 11 Jul 2001 19:01:39 GMT

Hi Rob,

Specifically, I want to call the +sharedInstance method on a class I've
developed for an application. Can I do that and then safely message the
returned object without using DO?

In general, no. Typically the singleton class method first checks if the singleton is already instantiated before instantiating the singleton if needed. If the check is not known to be thread safe then you can run in trouble with more than one singleton instance (which is a bad thing by definition :-) )

Greetings from Cologne,
Axel


  • Follow-Ups:
    • Re: Singleton instances and multithreading
      • From: Mike Shields <email@hidden>
    • Re: Singleton instances and multithreading
      • From: Mike Shields <email@hidden>
References: 
 >Singleton instances and multithreading (From: Rob Rix <email@hidden>)

  • Prev by Date: Re: Stopping a tool after launching with AuthorizationExecuteWithPrivileges
  • Next by Date: RE: Dockling Menus - How do I do a submenu?
  • Previous by thread: Singleton instances and multithreading
  • Next by thread: Re: Singleton instances and multithreading
  • Index(es):
    • Date
    • Thread