• 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: Rob Rix <email@hidden>
  • Date: Wed, 11 Jul 2001 23:33:48 -0400

As for messaging the object. It's not a problem in and of itself. There will be the usual issues of making sure the object properly obtains locks for access to data which two competing threads are trying to access, but these are all basic threading issues. Just make sure your object(s) follow the rules for being used in a multi-threaded environment, and you'
ll be fine.

Well, only the singleton instance will be able to change its data, but others will access it for reading (it checks the state of some of the file system).
So, will I need locks when reading from it, or just writing?

-- Rob

Man is a rational animal who always loses his temper when he is called upon to act in accordance with the dictates of reason. - Oscar Wilde


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

  • Prev by Date: Re: is the nextKeyView really used by Cocoa ?
  • Next by Date: Annoying Java Class/Nib problem
  • Previous by thread: Re: Singleton instances and multithreading
  • Next by thread: Re: Singleton instances and multithreading
  • Index(es):
    • Date
    • Thread