@@ -11,7 +11,7 @@ Swift Memory and Concurrency Model
1111
1212The goal of this writeup is to provide a safe and efficient way to model,
1313design, and implement concurrent applications in Swift. It is believed that it
14- will completely eliminate data races and reduce deadlocks in swift apps, and
14+ will completely eliminate data races and reduce deadlocks in Swift apps, and
1515will allow for important performance wins as well. This happens by eliminating
1616shared mutable data, locks, and the need for most atomic memory accesses. The
1717model is quite different from what traditional unix folks are used to
@@ -83,7 +83,7 @@ definition. These kinds are:
8383 b.list.data = 42 // error, can't change immutable data.
8484
8585 As part of mutable data, it is worth pointing out that mutable "global
86- variables" in swift are not truly global, they are local to the current actor
86+ variables" in Swift are not truly global, they are local to the current actor
8787 (somewhat similar to "thread local storage", or perhaps to "an ivar on the
8888 actor"). Immutable global variables (like lookup tables) are simple immutable
8989 data just like today. Global variables with "static constructors /
@@ -225,7 +225,7 @@ Performing synchronous operations
225225---------------------------------
226226
227227Asynchronous calls are nice and define away the possibility of deadlock, but at
228- some point you need to get a return value back and async programming is very
228+ some point, you need to get a return value back and async programming is very
229229awkward. To handle this, a 'synch' block is used. For example, the following is
230230valid::
231231
@@ -245,7 +245,7 @@ context.
245245Memory Ownership Model
246246----------------------
247247
248- Within an actor there is a question of how ownership is handled. It's not in the
248+ Within an actor, there is a question of how ownership is handled. It's not in the
249249scope of this document to say what the "one true model" is, but here are a
250250couple of interesting observations:
251251
@@ -265,7 +265,7 @@ couple of interesting observations:
265265 stop the world to do a collection. 2) actors have natural local quiescent
266266 points: when they have finished servicing a message, if their dispatch queue
267267 is empty, they go to sleep. If nothing else in the CPU needs the thread, it
268- would be a natural time to collect. 3) GC would be fully precise in swift ,
268+ would be a natural time to collect. 3) GC would be fully precise in Swift ,
269269 unlike in ObjC, no conservative stack scanning or other hacks are needed. 4)
270270 If GC is used for mutable data, it would make sense to still use reference
271271 counting for actors themselves and especially for immutable data, meaning
0 commit comments