Re: Dare I ... another volatile discussion ?

2015-05-10 Thread Kagamin via Digitalmars-d
On Saturday, 9 May 2015 at 16:59:35 UTC, Jens Bauer wrote: ... System calls will need to access the peripherals in some way, in order to send data to for instance a printer or harddisk. If the way it's done is using a memory location, then it's necessary to tell the compiler that this is not

Re: Dare I ... another volatile discussion ?

2015-05-10 Thread Jens Bauer via Digitalmars-d
On Sunday, 10 May 2015 at 12:43:31 UTC, Kagamin wrote: On Saturday, 9 May 2015 at 16:59:35 UTC, Jens Bauer wrote: ... System calls will need to access the peripherals in some way, in order to send data to for instance a printer or harddisk. If the way it's done is using a memory location,

Re: Dare I ... another volatile discussion ?

2015-05-09 Thread Jens Bauer via Digitalmars-d
On Thursday, 7 May 2015 at 21:42:08 UTC, Iain Buclaw wrote: On 7 May 2015 at 23:39, Iain Buclaw ibuc...@gdcproject.org wrote: When used properly though, it's properties make it a prime candidate for the foundation of libraries/programs that centre around the use of atomics. However, shared is

Re: Dare I ... another volatile discussion ?

2015-05-09 Thread Kagamin via Digitalmars-d
On Thursday, 7 May 2015 at 16:04:56 UTC, Jens Bauer wrote: Regarding (1), because marking a variable 'shared' is not enough (it allows instructions to be moved around), Johannes already made a volatileLoad and volatileStore, which will be usable for microcontrollers, though for convenience, it

Re: Dare I ... another volatile discussion ?

2015-05-09 Thread Jens Bauer via Digitalmars-d
On Saturday, 9 May 2015 at 12:16:58 UTC, Kagamin wrote: On Thursday, 7 May 2015 at 16:04:56 UTC, Jens Bauer wrote: Regarding (1), because marking a variable 'shared' is not enough (it allows instructions to be moved around), Johannes already made a volatileLoad and volatileStore, which will be

Re: Dare I ... another volatile discussion ?

2015-05-08 Thread Mike via Digitalmars-d
On Thursday, 7 May 2015 at 16:04:56 UTC, Jens Bauer wrote: So back to what originally triggered this post; this is what the question is actually about: If writing a driver for platform X, how is reading/writing hardware registers usually done in D ? Here's my pre 2.067 code for `volatile`

Re: Dare I ... another volatile discussion ?

2015-05-07 Thread Iain Buclaw via Digitalmars-d
On 7 May 2015 at 18:04, Jens Bauer via Digitalmars-d digitalmars-d@puremagic.com wrote: I'm sorry for opening such a topic; I've heard it's not liked a lot, but I think it might be necessary. I'm not asking for a 'volatile' keyword, but rather to find out what the right thing to use is.

Re: Dare I ... another volatile discussion ?

2015-05-07 Thread Johannes Pfau via Digitalmars-d
Am Thu, 07 May 2015 16:04:55 + schrieb Jens Bauer doc...@who.no: I'm sorry for opening such a topic; I've heard it's not liked a lot, but I think it might be necessary. I'm not asking for a 'volatile' keyword, but rather to find out what the right thing to use is. After reading a few

Re: Dare I ... another volatile discussion ?

2015-05-07 Thread Iain Buclaw via Digitalmars-d
On 7 May 2015 at 20:18, Johannes Pfau via Digitalmars-d digitalmars-d@puremagic.com wrote: If variable 'alice' and variable 'bob' are both shared, and reading from 'bob', then writing to 'alice'; would instructions be moved around, so reading from 'bob' could actually occur after writing to

Re: Dare I ... another volatile discussion ?

2015-05-07 Thread Iain Buclaw via Digitalmars-d
On 7 May 2015 at 23:39, Iain Buclaw ibuc...@gdcproject.org wrote: When used properly though, it's properties make it a prime candidate for the foundation of libraries/programs that centre around the use of atomics. However, shared is not to be confused with a thread-safe atomic type.

Dare I ... another volatile discussion ?

2015-05-07 Thread Jens Bauer via Digitalmars-d
I'm sorry for opening such a topic; I've heard it's not liked a lot, but I think it might be necessary. I'm not asking for a 'volatile' keyword, but rather to find out what the right thing to use is. After reading a few different threads related to microcontrollers, I started wondering how to