Re: Why do core.atomic functions require shared

2018-07-05 Thread Jonathan M Davis via Digitalmars-d
On Thursday, July 05, 2018 11:31:15 FeepingCreature via Digitalmars-d wrote: > On Wednesday, 4 July 2018 at 10:47:12 UTC, Jonathan M Davis wrote: > > At this point, to operate on anything that's shared, either > > means using atomics or protecting the data with a mutex (be > > that with a

Re: Why do core.atomic functions require shared

2018-07-05 Thread Andrea Fontana via Digitalmars-d
On Wednesday, 4 July 2018 at 10:47:12 UTC, Jonathan M Davis wrote: [cut] - Jonathan M Davis I think I've just read a similar explanation about shared written by you some months ago. It seems that a lot of users doesn't understand what shared really is. Probably a pinned article should be

Re: Why do core.atomic functions require shared

2018-07-05 Thread Atila Neves via Digitalmars-d
On Thursday, 5 July 2018 at 11:31:15 UTC, FeepingCreature wrote: On Wednesday, 4 July 2018 at 10:47:12 UTC, Jonathan M Davis wrote: [...] Once we have DIP1000, can accessing shared class members in a synchronized class (optionally? implicitly?) result in scoped rvalues? We already have

Re: Why do core.atomic functions require shared

2018-07-05 Thread FeepingCreature via Digitalmars-d
On Wednesday, 4 July 2018 at 10:47:12 UTC, Jonathan M Davis wrote: At this point, to operate on anything that's shared, either means using atomics or protecting the data with a mutex (be that with a synchronized block / function or a mutex object) and temporarily casting away shared while

Re: Why do core.atomic functions require shared

2018-07-04 Thread Boris-Barboris via Digitalmars-d
On Wednesday, 4 July 2018 at 10:47:12 UTC, Jonathan M Davis wrote: At this point, to operate on anything that's shared, either means using atomics or protecting the data with a mutex (be that with a synchronized block / function or a mutex object) and temporarily casting away shared while

Re: Why do core.atomic functions require shared

2018-07-04 Thread Jonathan M Davis via Digitalmars-d
On Wednesday, July 04, 2018 09:25:27 Boris-Barboris via Digitalmars-d wrote: > Given the pain of shared usage with std and pretty much every > library in existence, I cowboyed the server without this > qualifier. One of the mechanisms required atomic class reference > compare-and-set, and the

Why do core.atomic functions require shared

2018-07-04 Thread Boris-Barboris via Digitalmars-d
Given the pain of shared usage with std and pretty much every library in existence, I cowboyed the server without this qualifier. One of the mechanisms required atomic class reference compare-and-set, and the class reference is not shared, because it would otherwise require, like, 30 or 40