What is the difference between NSLock, @synchronized, and dispatch queues?

Updated May 17, 2026

Short answer

NSLock is explicit locking, @synchronized is syntactic sugar, and dispatch queues provide structured concurrency.

Deep explanation

@synchronized uses an internal mutex per object. NSLock provides manual lock/unlock control. GCD serial queues avoid locks entirely by ensuring ordered execution. Modern iOS prefers dispatch queues due to scalability and reduced deadlock risks.

Unlock with a Pro subscription to view this section.

View pricing

Real-world example

No real-world example available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Common mistakes

No common mistakes listed yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Follow-up questions

No follow-up questions available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

More Objective-C interview questions

View all →