• 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: Thu, 12 Jul 2001 01:23:32 -0400

So, you've got to figure out if two threads can do anything which changes state on the object. If so, then you'll need to protect them. If that's not the case, you'll need to ask yourself if it's OK for a reader thread to be able to interrupt the writer thread and look at potentially inconsistent data. If that can't happen, then I'd also protect it with locks.

Ah, okay. That explains it clearly, thanks.

I didn't realize it was quite so complicated as it is!

-- Rob

We are all in the gutter, but some of us are looking at the stars. - Oscar Wilde


References: 
 >Re: Singleton instances and multithreading (From: Rob Rix <email@hidden>)

  • Prev by Date: Re: Singleton instances and multithreading
  • Next by Date: Re: Singleton instances and multithreading
  • Previous by thread: Re: Singleton instances and multithreading
  • Next by thread: Re: Singleton instances and multithreading
  • Index(es):
    • Date
    • Thread