www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - TLS

reply M-exe <no valid.com> writes:
I found that D is great language, but for my own reasons I'm 
trying to use it without TLS at all.

Can the TLS directory be avoided? (compiling on windows)
I mean, can it avoided without losing GC and main language 
features?

I found out that also when with -vtls there is no output, there 
is TLS Directory in the final binary.
Mar 09
next sibling parent reply rikki cattermole <rikki cattermole.co.nz> writes:
On 10/03/2017 7:41 PM, M-exe wrote:
 I found that D is great language, but for my own reasons I'm trying to
 use it without TLS at all.

 Can the TLS directory be avoided? (compiling on windows)
 I mean, can it avoided without losing GC and main language features?

 I found out that also when with -vtls there is no output, there is TLS
 Directory in the final binary.
Wait, why on earth do you not want TLS?
Mar 09
parent reply M-exe <no valid.com> writes:
On Friday, 10 March 2017 at 06:46:03 UTC, rikki cattermole wrote:
 On 10/03/2017 7:41 PM, M-exe wrote:
 I found that D is great language, but for my own reasons I'm 
 trying to
 use it without TLS at all.

 Can the TLS directory be avoided? (compiling on windows)
 I mean, can it avoided without losing GC and main language 
 features?

 I found out that also when with -vtls there is no output, 
 there is TLS
 Directory in the final binary.
Wait, why on earth do you not want TLS?
Compatibility issues (like under XP) Solutions like this is not enough stable: https://github.com/dlang/druntime/blob/master/src/core/sys/windows/dll.d I'm searching for solution like the /Zc:threadSafeInit- flag under VS2015
Mar 09
parent reply rikki cattermole <rikki cattermole.co.nz> writes:
On 10/03/2017 8:06 PM, M-exe wrote:
 On Friday, 10 March 2017 at 06:46:03 UTC, rikki cattermole wrote:
 On 10/03/2017 7:41 PM, M-exe wrote:
 I found that D is great language, but for my own reasons I'm trying to
 use it without TLS at all.

 Can the TLS directory be avoided? (compiling on windows)
 I mean, can it avoided without losing GC and main language features?

 I found out that also when with -vtls there is no output, there is TLS
 Directory in the final binary.
Wait, why on earth do you not want TLS?
Compatibility issues (like under XP) Solutions like this is not enough stable: https://github.com/dlang/druntime/blob/master/src/core/sys/windows/dll.d I'm searching for solution like the /Zc:threadSafeInit- flag under VS2015
D does not support Windows XP. If you absolutely require it, you will have to contact Walter about support.
Mar 09
parent reply M-exe <no valid.com> writes:
On Friday, 10 March 2017 at 07:17:22 UTC, rikki cattermole wrote:
 D does not support Windows XP.
 If you absolutely require it, you will have to contact Walter 
 about support.
Let me care about it ;) I just need help with the TLS :)
Mar 09
parent reply bauss <jj_1337 live.dk> writes:
On Friday, 10 March 2017 at 07:33:44 UTC, M-exe wrote:
 On Friday, 10 March 2017 at 07:17:22 UTC, rikki cattermole 
 wrote:
 D does not support Windows XP.
 If you absolutely require it, you will have to contact Walter 
 about support.
Let me care about it ;) I just need help with the TLS :)
Mark your variables with __gshared. I would say shred, but it has some restrictions to it, where __gshared is the equivalent to global variables in C.
Mar 10
parent reply sarn <sarn theartofmachinery.com> writes:
On Friday, 10 March 2017 at 19:24:29 UTC, bauss wrote:
 Mark your variables with __gshared. I would say shred, but it 
 has some restrictions to it, where __gshared is the equivalent 
 to global variables in C.
immutable variables are also not put in TLS.
Mar 10
parent reply M-exe <not valid.com> writes:
On Friday, 10 March 2017 at 21:32:05 UTC, sarn wrote:
 On Friday, 10 March 2017 at 19:24:29 UTC, bauss wrote:
 Mark your variables with __gshared. I would say shred, but it 
 has some restrictions to it, where __gshared is the equivalent 
 to global variables in C.
immutable variables are also not put in TLS.
Thank you for yours replys but there is a tls directory even when I compile empty main..
Mar 13
parent Rainer Schuetze <r.sagitario gmx.de> writes:
On 13.03.2017 14:35, M-exe wrote:
 On Friday, 10 March 2017 at 21:32:05 UTC, sarn wrote:
 On Friday, 10 March 2017 at 19:24:29 UTC, bauss wrote:
 Mark your variables with __gshared. I would say shred, but it has
 some restrictions to it, where __gshared is the equivalent to global
 variables in C.
immutable variables are also not put in TLS.
Thank you for yours replys but there is a tls directory even when I compile empty main..
It's very likely that there are TLS variables in druntime that are linked in. You can identify them by looking at the map file.
Mar 13
prev sibling parent Joakim <dlang joakim.fea.st> writes:
On Friday, 10 March 2017 at 06:41:46 UTC, M-exe wrote:
 I found that D is great language, but for my own reasons I'm 
 trying to use it without TLS at all.

 Can the TLS directory be avoided? (compiling on windows)
I don't know what you mean by the TLS directory, can you explain?
 I mean, can it avoided without losing GC and main language 
 features?
You could probably modify druntime so that it doesn't use any Thread-Local Storage, but Phobos uses it extensively, as global and static variables are put in TLS by default since D 2.030: https://dlang.org/migrate-to-shared.html Are you against emulated TLS also? If not, I have modified dmd, ldc, and druntime to use the same emulated TLS scheme Walter came up with for OS X, for my Android port: https://github.com/dlang/dmd/pull/3643 https://github.com/ldc-developers/ldc/pull/1447 https://github.com/dlang/druntime/pull/784 You may be able to use something similar on Windows, depending on how feasible such an emulated TLS scheme is there and if you want to dig into these details.
Mar 13