On Tuesday, March 06, 2018 11:52:05 H. S. Teoh via Digitalmars-d-learn
wrote:
> On Tue, Mar 06, 2018 at 11:46:04AM -0700, Jonathan M Davis via
Digitalmars-d-learn wrote:
> > On Tuesday, March 06, 2018 18:34:34 bauss via Digitalmars-d-learn wrote:
> [...]
>
> > > Singletons are always smelly code
On Tue, Mar 06, 2018 at 11:46:04AM -0700, Jonathan M Davis via
Digitalmars-d-learn wrote:
> On Tuesday, March 06, 2018 18:34:34 bauss via Digitalmars-d-learn wrote:
[...]
> > Singletons are always smelly code tbh.
> >
> > Especially in D with thread-local storage.
> >
> > I can't think of a situat
On Tuesday, March 06, 2018 18:34:34 bauss via Digitalmars-d-learn wrote:
> On Monday, 5 March 2018 at 19:51:33 UTC, Steven Schveighoffer
>
> wrote:
> > On 3/5/18 2:25 PM, Marc wrote:
> >> Can __gshared be used instead of static in the singleton
> >> pattern? I, comming from C++, ignorantly, have ne
On Monday, 5 March 2018 at 19:51:33 UTC, Steven Schveighoffer
wrote:
On 3/5/18 2:25 PM, Marc wrote:
Can __gshared be used instead of static in the singleton
pattern? I, comming from C++, ignorantly, have never used
_gshared so I went to static instead of (being static also
means thread-safe,
On 3/5/18 2:25 PM, Marc wrote:
Can __gshared be used instead of static in the singleton pattern? I,
comming from C++, ignorantly, have never used _gshared so I went to
static instead of (being static also means thread-safe, as far I know)...
static in D is thread safe, because it's thread-lo
On Monday, 5 March 2018 at 19:39:35 UTC, Robert M. Münch wrote:
On 2018-03-05 18:57:01 +, Steven Schveighoffer said:
If you want to have methods, shared kind of sucks. But this at
least tells the type system that it's shared between threads.
Why does it suck?
Because your code will becom
On 3/5/18 2:39 PM, Robert M. Münch wrote:
On 2018-03-05 18:57:01 +, Steven Schveighoffer said:
On 3/5/18 1:35 PM, Robert M. Münch wrote:
1. Are myMemb1..N TLS or __gshared as well?
No, they are on the heap. Only the reference is __gshared. But
effectively it is __gshared, since you can
On 2018-03-05 18:57:01 +, Steven Schveighoffer said:
On 3/5/18 1:35 PM, Robert M. Münch wrote:
1. Are myMemb1..N TLS or __gshared as well?
No, they are on the heap. Only the reference is __gshared. But
effectively it is __gshared, since you can reach those items via the
global `myObj`.
On Monday, 5 March 2018 at 18:57:01 UTC, Steven Schveighoffer
wrote:
On 3/5/18 1:35 PM, Robert M. Münch wrote:
If I use VisualD and add a watch on myObj, I don't see
anything just a "identifier myObj is undefined". Not sure if
this is because of some threads running (using the D RX
framework)
On 3/5/18 1:35 PM, Robert M. Münch wrote:
If I use VisualD and add a watch on myObj, I don't see anything just a
"identifier myObj is undefined". Not sure if this is because of some
threads running (using the D RX framework).
Can't answer your visual D questions...
So, some questions:
1.
Hi, I'm feeling a bit dumb but anway...
For hacking prototypes I mostly create a class to store all kind of
values. Then I create one global instance of this class and use it
everywhere. Pseudocode looks like this:
class myClass {
myMemb1;
myMembN;
this(){...}
}
__gs
11 matches
Mail list logo