# SE-0302: ConcurrentValue and @concurrent closures

**URL:** <https://forums.swift.org/t/se-0302-concurrentvalue-and-concurrent-closures/44919>\
**Category:** Proposal Reviews\
**Tags:** concurrency\
**Created:** [February 19, 2021, 10:30pm UTC](https://forums.swift.org/t/se-0302-concurrentvalue-and-concurrent-closures/44919 "2021-02-19T22:30:29Z")\
**Posts on this page:** 1\
**Showing post:** 78

<div class="post-metadata">

**Author:** ![cukr](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/cukr/32/889_2.png) [@cukr](https://forums.swift.org/u/cukr)\
**Post date:** [March 2, 2021, 12:20am UTC](https://forums.swift.org/t/se-0302-concurrentvalue-and-concurrent-closures/44919/78 "2021-03-02T00:20:41Z")

</div>

> [@Chris\_Lattner3](#):
>
> This proposal is orthogonal to making global variable access safe. There are at least two different proposals to how to handle this (e.g. [mine](https://docs.google.com/document/d/1DKRs1mknTxB1s04KTVgteAmzh51ubk6-hA-HRSr7mzY/edit?pli=1#heading=h.g6mikums3i2o)), and both compose correctly with this proposal.

Thanks! Didn't realize that there will be other proposals that will make it safe.

> [@Douglas\_Gregor](#):
>
> There are two reasons I disagree. The first is that this proposal is part of a larger arc for Swift Concurrency: it solves a necessary part of the problem of data races, but is not sufficient to solve all data races. Trying to solve all problems at once leads to proposals that are too large to meaningful digest or discuss.

I'm happy with problems being broken up into multiple proposals! I just noticed that the checks in the proposal are not sufficient to ensure safety, and wanted to know if there's something I'm missing. The first reply sounded like the safety wouldn't be introduced until long time into the future (swift 6 is often used as a hypothetical release when there are breaking changes, which I don't see happening any time soon). Now I know that the handrails will be reinforced before concurrency is out :)

> [@Douglas\_Gregor](#):
>
> you're conflating a type-level statement (values of the type can be shared across concurrency domains) with a more global statement (every operation on the type is free of data races), and they need not be conflated.

In the pitch thread I asked what are the requirements for conforming to the `ConcurrentValue` protocol, and the answer was that [all public API should be usable across concurrency domains](https://forums.swift.org/t/pitch-3-concurrentvalue-and-concurrent-closures/43947/13)

If that's not what "can be shared across concurrency domains" means, then could you tell me what does it mean? As far as I know values of **all types** can be shared across threads, as long as you don't perform any operations on them.

> [@Douglas\_Gregor](#):
>
> we look to doing something with global variables specifically to address the issue.

I'm looking forward to it!

---

_[View the full topic](https://forums.swift.org/t/se-0302-concurrentvalue-and-concurrent-closures/44919)._
