Hi,

reading the other shared thread "shared - i need to be useful"(https://forum.dlang.org/thread/mailman.4299.1539629222.29801.digitalmar...@puremagic.com)

let me to an important realisation concerning the reason shareding data across threads is so unintuitve and hard to get right. The reason is that sharing in the real world has nothing to do with using something and the same time. For example: If I share my flat with another person, that person, while occupying the same flat as me, cannot actually occupy the same space. It is physically impossible.

In other words sharing does not mean for multiple entities to own something it's rather about diving and managing the (temporary) ownership of fragments.

Therefore if ownership is unclear sharing is impossible.
The safest default for something shared with unclear ownership is to view it as untouchable/unreadble/unwritable until ownership is established.

Reply via email to