dsimcha wrote:
According to both the docs and my own experiments, thread_needLock() in
core.thread returns a bool that depends on whether the current process has
*ever* been multithreaded at *any* point in its execution. In Phobos's GC
(pre-druntime), a similar function existed, but it returned
According to both the docs and my own experiments, thread_needLock() in
core.thread returns a bool that depends on whether the current process has
*ever* been multithreaded at *any* point in its execution. In Phobos's GC
(pre-druntime), a similar function existed, but it returned a bool based on
w
Gregor Richards wrote:
I ran into a situation where I needed (essentially) the visitor pattern, but
the visitor pattern sucks, so I wanted to make something like class extensions
instead (that is, methods added to a class outside of the class definition).
I usually use this pattern but make i
On 2008-12-05 16:27:01 +0100, Andrei Alexandrescu
<[EMAIL PROTECTED]> said:
Fawzi Mohamed wrote:
On 2008-12-05 07:02:37 +0100, Andrei Alexandrescu
<[EMAIL PROTECTED]> said:
[...]
Well any integral value carries:
a) type as per the C rule
b) minimum value possible
c) maximum value possibl
Gregor Richards wrote:
Robert Fraser wrote:
Gregor Richards wrote:
I ran into a situation where I needed (essentially) the visitor
pattern, but the visitor pattern sucks, so I wanted to make something
like class extensions instead (that is, methods added to a class
outside of the class defini
On Fri, Dec 5, 2008 at 7:29 PM, Walter Bright
<[EMAIL PROTECTED]> wrote:
> That's like saying one works as an auto mechanic but prefers to use a rock
> rather than a hammer because a hammer costs $15 !! It's just far too useful
> to not buy at such a reasonable price.
>
> Even so, obj2asm is free o
Robert Fraser wrote:
Gregor Richards wrote:
I ran into a situation where I needed (essentially) the visitor
pattern, but the visitor pattern sucks, so I wanted to make something
like class extensions instead (that is, methods added to a class
outside of the class definition).
Of course, it's
Gregor Richards wrote:
I ran into a situation where I needed (essentially) the visitor pattern, but
the visitor pattern sucks, so I wanted to make something like class extensions
instead (that is, methods added to a class outside of the class definition).
Of course, it's not possible to do thi
Jarrett Billingsley wrote:
On Fri, Dec 5, 2008 at 5:38 PM, Walter Bright
<[EMAIL PROTECTED]> wrote:
TLS is always going to be slow. Beating the old drum about how freakin'
useful a tool obj2asm is and why doesn't anyone use it, here's what it looks
like:
Er, Walter, you realize it's not free,
Jérôme M. Berger wrote:
Actually, on Linux, the stack for the main thread grows dynamically
until it reaches the allowed size.
That's exactly what I said. It didn't occur to me beforehand that you
could preallocate the stack, but now that I think about it, nobody would
be happy if Lin
Walter Bright, el 5 de diciembre a las 15:05 me escribiste:
> Sean Kelly wrote:
> >I disagree. D is a systems app and so should not require termination on
> >any error. The distinction to me is that Errors require special handling
> >if recovery is to be attempted, while it's often safe (if bad
Thanks, guys. I've found ways to speed things up a decent amount, and put an
alpha of my SuperStack up on Scrapple, though I renamed it to TempAlloc because
I
don't like the name SuperStack. See D.announce and
http://dsource.org/projects/scrapple/browser/trunk/tempAlloc
On Fri, Dec 5, 2008 at 5:38 PM, Walter Bright
<[EMAIL PROTECTED]> wrote:
> TLS is always going to be slow. Beating the old drum about how freakin'
> useful a tool obj2asm is and why doesn't anyone use it, here's what it looks
> like:
Er, Walter, you realize it's not free, right? Meaning that even
Christopher Wright wrote:
Walter Bright wrote:
nothrow void foo();
void bar()
{
try
{
foo();
}
finally
{
will_never_execute(); // even if foo() throws
}
}
because the compiler will optimize away the finally clause.
! ! !
Surely you mean "catch" rather tha
Sean Kelly wrote:
I disagree. D is a systems app and so should not require termination on
any error. The distinction to me is that Errors require special handling
if recovery is to be attempted, while it's often safe (if bad practice) to
simply log Exceptions and soldier on. That isn't to say
Leandro Lucarella wrote:
For example, I'm working on a softswitch (unfortunately no in D). Lets say
we have a really bad moment and all the subscribers want to talk at the
same time and we don't support that workload. Lets say our memory is
exhausted and a new call arrive. A new allocation is don
dsimcha wrote:
Thanks, though I'm way ahead of you in that I already did this. Works great,
except it's a little bit slow.
TLS is always going to be slow. Beating the old drum about how freakin'
useful a tool obj2asm is and why doesn't anyone use it, here's what it
looks like:
== Quote from dsimcha ([EMAIL PROTECTED])'s article
>
> Thanks, though I'm way ahead of you in that I already did this. Works great,
> except it's a little bit slow.
> I'm actually working on an implementation of the SuperStack proposed by Andrei
> about a month ago, which was why I needed good TL
"bearophile" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Nick Sabalausky:
>> bearophile:
>> > But the dynamic languages allow you to save time in other ways.
>>
>> I'd argue that most of those time-saving things are things that have
>> absolutely nothing to do with dynamic typing
> Yeah, I'm using the same hack (i.e. defining private static const members)
> to denote some members characteristics, e.g. whether a member is
> serializable, its value is written to log etc.
Is the code open source? I was intending to put together some kind of better
integrated protobufs eq
== Quote from Sean Kelly ([EMAIL PROTECTED])'s article
> Oh! You're using the built-in thread-local storage. I don't think that's
> fully
> implemented yet (Walter, please correct me if I'm wrong). You might want to
> use the thread-local storage feature in the Thread class for now. Depending
On Sat, 06 Dec 2008 00:13:40 +0300, Mike Hearn <[EMAIL PROTECTED]> wrote:
The language spec is ambiguous, and DMD can apparently do either. This
program prints
[a __T3TagS23_D11smartstruct4Test1aiVi1Z b
__T3TagS24_D11smartstruct4Test1bAaVi2Z]
Note: this is a lame-ass hack around the lack
The language spec is ambiguous, and DMD can apparently do either. This program
prints
[a __T3TagS23_D11smartstruct4Test1aiVi1Z b
__T3TagS24_D11smartstruct4Test1bAaVi2Z]
Note: this is a lame-ass hack around the lack of real metadata attributes in
D2. It'd be nice if the real thing was supported
== Quote from dsimcha ([EMAIL PROTECTED])'s article
> == Quote from Sean Kelly ([EMAIL PROTECTED])'s article
> > Weird. The actual storage for TLS in druntime is an array of void*
> > within the Thread class. I can't imagine that it wouldn't be scanned by
> > the GC. Do you have a reproducible t
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Christopher Wright wrote:
> Nick Sabalausky wrote:
>> On a side note, stack overflows are still possible anyway (whether
>> functional or imperative). Is there a reason (other than inertia) that
>> stack frames aren't set up like a dynamic array to gro
Steven Schveighoffer wrote:
I'd say most likely that the GC doesn't see anything declared as __thread,
so when you use that pointer as the only reference to GC allocated data, it
doesn't see that it's still in use, and will collect.
Looks like I need to do some research to see how the gc can d
== Quote from Steven Schveighoffer ([EMAIL PROTECTED])'s article
> "dsimcha" wrote
> > == Quote from Sean Kelly ([EMAIL PROTECTED])'s article
> >> Weird. The actual storage for TLS in druntime is an array of void*
> >> within the Thread class. I can't imagine that it wouldn't be scanned by
> >> t
"dsimcha" wrote
> == Quote from Sean Kelly ([EMAIL PROTECTED])'s article
>> Weird. The actual storage for TLS in druntime is an array of void*
>> within the Thread class. I can't imagine that it wouldn't be scanned by
>> the GC. Do you have a reproducible test case?
>> Sean
>
> I just now manage
I ran into a situation where I needed (essentially) the visitor pattern, but
the visitor pattern sucks, so I wanted to make something like class extensions
instead (that is, methods added to a class outside of the class definition).
Of course, it's not possible to do this particularly cleanly, b
== Quote from Sean Kelly ([EMAIL PROTECTED])'s article
> Weird. The actual storage for TLS in druntime is an array of void*
> within the Thread class. I can't imagine that it wouldn't be scanned by
> the GC. Do you have a reproducible test case?
> Sean
I just now managed to play around with thi
Nick Sabalausky:
> bearophile:
> > But the dynamic languages allow you to save time in other ways.
>
> I'd argue that most of those time-saving things are things that have
> absolutely nothing to do with dynamic typing and are perfectly possible with
> static typing.
I mostly agree, what I want
One thing I forgot to mention in the orig. post: This happens in
single-threaded
apps. I discovered this when writing a library struct, and haven't even tried
to
actually use multithreading yet.
Fawzi Mohamed wrote:
On 2008-12-05 07:02:37 +0100, Andrei Alexandrescu
<[EMAIL PROTECTED]> said:
Sergey Gromov wrote:
Thu, 04 Dec 2008 09:54:32 -0800, Andrei Alexandrescu wrote:
Fawzi Mohamed wrote:
On 2008-12-01 22:30:54 +0100, Walter Bright
<[EMAIL PROTECTED]> said:
Fawzi Mohamed wrot
"bearophile" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> But the dynamic languages allow you to save time in other ways.
I'd argue that most of those time-saving things are things that have
absolutely nothing to do with dynamic typing and are perfectly possible with
static t
"Robert Fraser" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Nick Sabalausky Wrote:
>> That's the reason I refuse to use dynamic languages and
>> indentation-syntax
>> languages whenever I have a choice. They're nothing but a giant step
>> backwards, constantly replacing the most
On 2008-12-05 07:02:37 +0100, Andrei Alexandrescu
<[EMAIL PROTECTED]> said:
Sergey Gromov wrote:
Thu, 04 Dec 2008 09:54:32 -0800, Andrei Alexandrescu wrote:
Fawzi Mohamed wrote:
On 2008-12-01 22:30:54 +0100, Walter Bright <[EMAIL PROTECTED]> said:
Fawzi Mohamed wrote:
On 2008-12-01 21:16
there is no simple way to scan TSL from another thread, TSL was designed to be
thread-local after all :)
Bill Baxter Wrote:
> Bummer.
>
> Does a static-sized array initializer also allocate?
>
> int[4] v = [1,2,3,4];
> foreach(x; v) {
> /// ...
> }
http://d.puremagic.com/issues/show_bug.cgi?id=2356
Don:
> I think for dynamic languages, test-driven development is mandatory.
I generally write tests after the code in all languages I use :-) Maybe I'll
learn to use TDD in the future, who knows.
> But you have to write zillions of tests because the compiler accepts all
> kinds of garbage. [..
On 2008-12-05 02:53:11 +0100, Sergey Gromov <[EMAIL PROTECTED]> said:
Thu, 04 Dec 2008 09:54:32 -0800, Andrei Alexandrescu wrote:
Fawzi Mohamed wrote:
On 2008-12-01 22:30:54 +0100, Walter Bright <[EMAIL PROTECTED]>
said:
Fawzi Mohamed wrote:
On 2008-12-01 21:16:58 +0100, Walter Bright
<[EM
On 2008-12-05 09:40:03 +0100, Don <[EMAIL PROTECTED]> said:
Andrei Alexandrescu wrote:
Sergey Gromov wrote:
Thu, 04 Dec 2008 09:54:32 -0800, Andrei Alexandrescu wrote:
Fawzi Mohamed wrote:
On 2008-12-01 22:30:54 +0100, Walter Bright <[EMAIL PROTECTED]> said:
Fawzi Mohamed wrote:
On 2008-
Andrei Alexandrescu wrote:
Sergey Gromov wrote:
Thu, 04 Dec 2008 09:54:32 -0800, Andrei Alexandrescu wrote:
Fawzi Mohamed wrote:
On 2008-12-01 22:30:54 +0100, Walter Bright
<[EMAIL PROTECTED]> said:
Fawzi Mohamed wrote:
On 2008-12-01 21:16:58 +0100, Walter Bright
<[EMAIL PROTECTED]> said:
bearophile wrote:
Bill Baxter:
You never mistype the name of a variable?
Probably I do such mistakes often or very often, but I test every little piece
of code I write, so such bugs are fixed seconds or minutes after I have put
them in, so even not using an IDE I have never felt it as proble
43 matches
Mail list logo