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

What are the rules of variable?

1 Answers  


What is objective writing?

1 Answers  


Is swift faster than objective c?

1 Answers  


What is nsarray objective c?

1 Answers  


How do I import a swift file into objective c?

1 Answers  


What is a .m file in xcode?

1 Answers  


Can protocols have properties?

1 Answers  


What do you understand by protocol?

1 Answers  


What's the difference between a thread safe and a thread unsafe function?

1 Answers  


What is objective c runtime?

1 Answers  


What is umbrella header?

1 Answers  


Explain how to call a function in objective-c?

1 Answers  


Categories