• 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: Thread safty audit & +initialize ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Thread safty audit & +initialize ?


  • Subject: Re: Thread safty audit & +initialize ?
  • From: Brant Vasilieff <email@hidden>
  • Date: Wed, 25 Jul 2001 08:26:44 -0700

Any idea what would cause it to get called multiple times for a single thread? I suppose someone could explicitly call it in their code, but I was under the impression that it was part of the runtime model and would only be called once. Unfortunately, I haven't been able to find much documentation about it.

On Wednesday, July 25, 2001, at 01:45 AM, John C. Randolph wrote:

On Tuesday, July 24, 2001, at 11:10 PM, Brant Vasilieff wrote:

I'm almost done with my threading audit for one application, but I'm curious. Is it theoretically possible for a class initialization to get called twice by two threads?

Not only that, it's possible for +initialize to get called multiple times in a single-threaded app. Whenever I'm creating a shared instance, I *always* check before creating it.


References: 
 >Re: Thread safty audit & +initialize ? (From: "John C. Randolph" <email@hidden>)

  • Prev by Date: RE: Objective-C++
  • Next by Date: RE: Clearing an NSView
  • Previous by thread: Re: Thread safty audit & +initialize ?
  • Next by thread: iconForFile in a thread
  • Index(es):
    • Date
    • Thread