Re: Address of data that is static, be it shared or tls or __gshared or immutable on o/s

2017-09-11 Thread Moritz Maxeiner via Digitalmars-d-learn
On Monday, 11 September 2017 at 22:38:21 UTC, Walter Bright wrote: If an address is taken to a TLS object, any relocations and adjustments are made at the time the pointer is generated, not when the pointer is dereferenced. Could you elaborate on that explanation more? The way I thought

Re: Address of data that is static, be it shared or tls or __gshared or immutable on o/s

2017-09-11 Thread Ali Çehreli via Digitalmars-d-learn
On 09/11/2017 03:38 PM, Walter Bright wrote: > If an address is taken to a TLS object, any relocations and adjustments > are made at the time the pointer is generated, not when the pointer is > dereferenced. Hence, the pointer may be passed from thread to thread, > and will still point to the

Re: Address of data that is static, be it shared or tls or __gshared or immutable on o/s

2017-09-11 Thread Walter Bright via Digitalmars-d-learn
On 9/10/2017 2:38 PM, Cecil Ward wrote: Ali, I have worked on operating systems' development in r+d. My definitions of terms are hopefully the same as yours. If we refer to two threads, if they both belong to the same process, then they share a common address space, by my definition of the

Re: Address of data that is static, be it shared or tls or __gshared or immutable on o/s

2017-09-11 Thread Ali Çehreli via Digitalmars-d-learn
On 09/11/2017 01:51 AM, John Burton wrote: > I wrote this program :- > > import std.stdio; > import std.concurrency; > > int data; > > void display() > { > writeln("Address is ", ); > } > > void main() > { > auto tid1 = spawn(); > auto tid2 = spawn(); > auto tid3 = spawn(); > } >

Re: Address of data that is static, be it shared or tls or __gshared or immutable on o/s

2017-09-11 Thread John Burton via Digitalmars-d-learn
On Sunday, 10 September 2017 at 21:38:03 UTC, Cecil Ward wrote: On Wednesday, 6 September 2017 at 15:55:35 UTC, Ali Çehreli wrote: [...] Ali, I have worked on operating systems' development in r+d. My definitions of terms are hopefully the same as yours. If we refer to two threads, if they

Re: Address of data that is static, be it shared or tls or __gshared or immutable on o/s

2017-09-10 Thread Cecil Ward via Digitalmars-d-learn
On Wednesday, 6 September 2017 at 15:55:35 UTC, Ali Çehreli wrote: On 09/06/2017 08:27 AM, Cecil Ward wrote: > If someone has some static data somewhere, be it in tls or marked shared > __gshared or immutable or combinations (whatever), and someone takes the > address of it and pass that address

Re: Address of data that is static, be it shared or tls or __gshared or immutable on o/s

2017-09-06 Thread Ali Çehreli via Digitalmars-d-learn
On 09/06/2017 08:27 AM, Cecil Ward wrote: > If someone has some static data somewhere, be it in tls or marked shared > __gshared or immutable or combinations (whatever), and someone takes the > address of it and pass that address to some other routine of mine that > does not have access to the

Address of data that is static, be it shared or tls or __gshared or immutable on o/s

2017-09-06 Thread Cecil Ward via Digitalmars-d-learn
If someone has some static data somewhere, be it in tls or marked shared __gshared or immutable or combinations (whatever), and someone takes the address of it and pass that address to some other routine of mine that does not have access to the source code of the original definition of the