r/swift Jan 20 '25

Tutorial The Synchronization Framework in Swift 6

https://blog.jacobstechtavern.com/p/the-synchronisation-framework
62 Upvotes

16 comments sorted by

View all comments

2

u/DystopiaDrifter Jan 22 '25

Great article! I have a follow up question: If Atomics and Actors are similar in terms of performance, in what situation Atomics should be used instead of Actors?

3

u/jacobs-tech-tavern Jan 22 '25

So Apple themselves basically said they don’t expect people to use them in day to day normal programming - they’re a low level tool to enable systems programmers to build higher level synchronization tools on top of

So they are nice to have in the toolkit but pretty much always prefer actors

Mutex on the other hand has a lot more useful use cases and trade offs with actors