<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div class="">On Nov 30, 2016, at 11:58 AM, Alexis <<a href="mailto:abeingessner@apple.com" class="">abeingessner@apple.com</a>> wrote:</div><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><blockquote type="cite" class=""><div class="">On Nov 30, 2016, at 12:41 PM, John McCall via swift-dev <<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">When we say that we don't have a concurrency model, we mean that (1) we aren't providing a more complete language solution than the options available to C programmers and (2) like C pre-C11/C++11, we have not yet formalized a memory model for concurrency that provides formal guarantees about what accesses are guaranteed to not conflict if they do race. (For example, we are unlikely to guarantee that accesses to different properties of a struct can occur in parallel, but we may choose to make that guarantee for different properties of a class.)</div><br class="Apple-interchange-newline"></div></blockquote></div><br class=""><div class="">I’d actually been intending to ask about this. Is there any reason why the lowest level won’t just be a fairly vanilla copy-paste of the C11 concurrency model. That is, there’s non-atomic/relaxed/acquire/release/seqcst loads and stores, and all the happens-before graph stuff that comes along with it. I imagine doing anything else would be fairly challenging for LLVM?</div></div></div></blockquote></div><br class=""><div class="">Well, that would be the basic approach, but you still have to define what accesses are non-interfering. C, for example, says that ordinary fields can be independently accessed without racing, but bitfields generally cannot. That rule (among others) prohibits certain layout optimizations that we'd like to still do in Swift, e.g. packing Bool properties together.</div><div class=""><br class=""></div><div class="">John.</div></body></html>