Re: A few questions about safe concurrent programming assumptions

2013-10-07 Thread John Colvin
On Monday, 7 October 2013 at 05:26:10 UTC, Nicholas Smith wrote: Thanks Jonathon, these are the kinds of warnings I was looking for. There are _no_ guarantees of atomicity with shared. Yes, on some architectures, writing a word size might be atomic, but the language guarantees no such thing.

Re: A few questions about safe concurrent programming assumptions

2013-10-06 Thread Jonathan M Davis
On Monday, October 07, 2013 07:26:02 Nicholas Smith wrote: > Thanks Jonathon, these are the kinds of warnings I was looking > for. > > > There are _no_ guarantees of atomicity with shared. Yes, on some > > architectures, writing a word size might be atomic, but the > > language > > guarantees no s

Re: A few questions about safe concurrent programming assumptions

2013-10-06 Thread Nicholas Smith
Thanks Jonathon, these are the kinds of warnings I was looking for. There are _no_ guarantees of atomicity with shared. Yes, on some architectures, writing a word size might be atomic, but the language guarantees no such thing. I was looking narrowly at x86, which I *think* such a statement

Re: A few questions about safe concurrent programming assumptions

2013-10-06 Thread Jonathan M Davis
On Thursday, October 03, 2013 08:34:00 Nicholas Smith wrote: > * Reads and writes to shared variables with a size equal to or > less than the word size of the machine are atomic and are visible > to all other threads immediately. There are _no_ guarantees of atomicity with shared. Yes, on some ar

A few questions about safe concurrent programming assumptions

2013-10-06 Thread Nicholas Smith
So I suppose shared is confusing to everyone else, too. :) I'll just wing it and fill my program with rare but devastating bugs ;)

A few questions about safe concurrent programming assumptions

2013-10-02 Thread Nicholas Smith
Hi there, I have a few questions about what is safe to assume when writing concurrent code in D with data sharing (as opposed to message passing). After doing a fair amount of reading, I'm still slightly hazy about what shared does and doesn't guarantee. Here is the only assumption I unders