Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How dispatch_once runs only once?



How dispatch_once runs only once?..

Answer / Mrinal Kaushick

dispatch_once is a function provided by Apple's Grand Central Dispatch (GCD) library in Objective-C. It ensures that a block of code is executed no more than once during the lifetime of a particular process. This is achieved through an atomic flag, which prevents multiple threads from executing the block concurrently. The first time the function dispatch_once() is called for a specific control variable, the associated block will be executed. Subsequent calls to dispatch_once() with the same control variable will not execute the block again.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Objective-C Interview Questions

Can protocols have properties?

1 Answers  


Can you differentiate polymorphism from abstraction?

1 Answers  


What optional binding?

1 Answers  


What is instance variable objective c?

1 Answers  


What is gcd objective c?

1 Answers  


What is objective point of view?

1 Answers  


Can you please explain the way messaging works in objective-c?

1 Answers  


What is m file?

1 Answers  


What is single inheritance in objective-c?

1 Answers  


What is the difference between method and type?

1 Answers  


Is swift faster than objective c?

1 Answers  


What objective-c program consists of?

1 Answers  


Categories