Re: D2 weak references

2009-04-20 Thread Leandro Lucarella
Michel Fortin, el 20 de abril a las 18:53 me escribiste: > On 2009-04-20 18:31:28 -0400, Sean Kelly said: > > >Yeah. The unfortunate tradeoff is that finalizers are run while all these > >app threads are suspended, and if these finalizers enter a synchronized > >block they're likely to deadlock.

Re: Fully dynamic d by opDotExp overloading

2009-04-20 Thread Christopher Wright
Michel Fortin wrote: On 2009-04-20 07:25:43 -0400, Christopher Wright said: BCS wrote: Hello Christopher, The utility is when you are looking for methods to invoke via runtime reflection, you can determine that a given function is one of these runtime opDotExp equivalents. So it is being

Re: D2 weak references

2009-04-20 Thread Daniel Keep
Sean Kelly wrote: > == Quote from Jason House (jason.james.ho...@gmail.com)'s article >> Sean Kelly Wrote: >>> You're guaranteed that the GC will notify you when it finalizes >>> the referenced object, so you shouldn't have to query the GC >>> at all. Just copy the reference into a GC-scannable

Re: D2 weak references

2009-04-20 Thread Michel Fortin
On 2009-04-20 18:31:28 -0400, Sean Kelly said: Yeah. The unfortunate tradeoff is that finalizers are run while all these app threads are suspended, and if these finalizers enter a synchronized block they're likely to deadlock. This happened enough with the Phobos GC that I was motivated to ma

Re: D2 weak references

2009-04-20 Thread Sean Kelly
== Quote from Jason House (jason.james.ho...@gmail.com)'s article > Jarrett Billingsley Wrote: > > On Mon, Apr 20, 2009 at 5:03 PM, Sean Kelly wrote: > > > > > The horrible thing about all this is it makes using a multithreaded > > > WeakRef horribly slow. �Even if the GC facility were provided fo

Re: D2 weak references

2009-04-20 Thread Sean Kelly
== Quote from Jason House (jason.james.ho...@gmail.com)'s article > Sean Kelly Wrote: > > > > The horrible thing about all this is it makes using a multithreaded > > WeakRef horribly slow. Even if the GC facility were provided for > > what you want to do you're talking about acquiring a mutex in >

Re: D2 weak references

2009-04-20 Thread Leandro Lucarella
Jason House, el 20 de abril a las 17:45 me escribiste: > As a side note, does druntime use multiple threads for the garbage > collector? No, but I'm planning to add concurrency support to the GC. D1 and Posix OSs, though. Porting to D2 should be fairly easy because I'll use Tango's GC as base, whi

Re: Vectors and matrices

2009-04-20 Thread JC
Lars, I would be happy for you to take a look at it. If you will send me a private e-mail to this address, I'll get my package to you. JC Lars Kyllingstad Wrote: > JC wrote: > > I do a lot of linear work with economic models in D at work. For this > > reason I created small matrix and vector pa

Re: D2 weak references

2009-04-20 Thread Jason House
Jarrett Billingsley Wrote: > On Mon, Apr 20, 2009 at 5:03 PM, Sean Kelly wrote: > > > The horrible thing about all this is it makes using a multithreaded > > WeakRef horribly slow.  Even if the GC facility were provided for > > what you want to do you're talking about acquiring a mutex in > > th

Re: D2 weak references

2009-04-20 Thread Jason House
Sean Kelly Wrote: > == Quote from Jason House (jason.james.ho...@gmail.com)'s article > > Sean Kelly Wrote: > > > > > > You're guaranteed that the GC will notify you when it finalizes > > > the referenced object, so you shouldn't have to query the GC > > > at all. Just copy the reference into a G

Re: D2 weak references

2009-04-20 Thread Sean Kelly
== Quote from Jarrett Billingsley (jarrett.billings...@gmail.com)'s article > On Mon, Apr 20, 2009 at 5:03 PM, Sean Kelly wrote: > > The horrible thing about all this is it makes using a multithreaded > > WeakRef horribly slow.  Even if the GC facility were provided for > > what you want to do you

Re: randomCover not so random?

2009-04-20 Thread dsimcha
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article > dsimcha wrote: > > Maybe I'm doing something subtly wrong here, but I've checked all the > > obvious > > stuff. > > > > import std.stdio, std.random, std.array; > > > > import dstats.base : Perm; > > > > void main() { >

Re: D2 weak references

2009-04-20 Thread Jarrett Billingsley
On Mon, Apr 20, 2009 at 5:03 PM, Sean Kelly wrote: > The horrible thing about all this is it makes using a multithreaded > WeakRef horribly slow.  Even if the GC facility were provided for > what you want to do you're talking about acquiring a mutex in > the GC for every deref operation.  What a

Re: randomCover not so random?

2009-04-20 Thread Andrei Alexandrescu
dsimcha wrote: Maybe I'm doing something subtly wrong here, but I've checked all the obvious stuff. import std.stdio, std.random, std.array; import dstats.base : Perm; void main() { uint[int[]] counts; immutable int[] foo = [1,2,3]; // Make sure every permutation is represented in

Re: D2 weak references

2009-04-20 Thread Fawzi Mohamed
On 2009-04-20 22:19:42 +0200, Jason House said: Sean Kelly Wrote: == Quote from Jason House (jason.james.ho...@gmail.com)'s article Jason House Wrote: If I understand you correctly, a weak reference library needs to query the GC to see if an object is marked for collection. How do I do t

Re: D2 weak references

2009-04-20 Thread Sean Kelly
== Quote from Jason House (jason.james.ho...@gmail.com)'s article > Sean Kelly Wrote: > > > > You're guaranteed that the GC will notify you when it finalizes > > the referenced object, so you shouldn't have to query the GC > > at all. Just copy the reference into a GC-scannable location > > and th

randomCover not so random?

2009-04-20 Thread dsimcha
Maybe I'm doing something subtly wrong here, but I've checked all the obvious stuff. import std.stdio, std.random, std.array; import dstats.base : Perm; void main() { uint[int[]] counts; immutable int[] foo = [1,2,3]; // Make sure every permutation is represented in counts. fore

Re: D2 weak references

2009-04-20 Thread Jason House
Sean Kelly Wrote: > == Quote from Jason House (jason.james.ho...@gmail.com)'s article > > Jason House Wrote: > > > > > > If I understand you correctly, a weak reference library needs to query > > > the GC to see if an object is > marked for collection. How do I do this? > > Here's the implementat

Re: D2 weak references

2009-04-20 Thread Sean Kelly
== Quote from Jason House (jason.james.ho...@gmail.com)'s article > Jason House Wrote: > > > > If I understand you correctly, a weak reference library needs to query the > > GC to see if an object is marked for collection. How do I do this? > Here's the implementation I'm currently thinking of: >

Re: D2 weak references

2009-04-20 Thread Sean Kelly
== Quote from Jason House (jason.james.ho...@gmail.com)'s article > Sean Kelly Wrote: > > Daniel Keep wrote: > > > > > > Sean Kelly wrote: > > >> Jason House wrote: > > >>> Jason House wrote: > > >>> > > Tango's GC (and therefore > > druntime's GC) has an explicit notification mechanism.

Re: D2 weak references

2009-04-20 Thread Jason House
Jason House Wrote: > Sean Kelly Wrote: > > > Daniel Keep wrote: > > > > > > Sean Kelly wrote: > > >> Jason House wrote: > > >>> Jason House wrote: > > >>> > > Tango's GC (and therefore > > druntime's GC) has an explicit notification mechanism. > > >>> I guess I shouldn't have assumed t

Re: temporary objects are not allowed to be pass by ref anymore

2009-04-20 Thread Jérôme M. Berger
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Yigal Chripun wrote: > On 19/04/2009 22:52, Andrei Alexandrescu wrote: >> Jarrett Billingsley wrote: >>> On Sun, Apr 19, 2009 at 8:41 AM, Denis Koroskin <2kor...@gmail.com> >>> wrote: What's a rationale behind an issue described bug 2621? htt

Re: D2 weak references

2009-04-20 Thread Jason House
Sean Kelly Wrote: > Daniel Keep wrote: > > > > Sean Kelly wrote: > >> Jason House wrote: > >>> Jason House wrote: > >>> > Tango's GC (and therefore > druntime's GC) has an explicit notification mechanism. > >>> I guess I shouldn't have assumed that the features of tango became > >>> par

Re: D2 weak references

2009-04-20 Thread Sean Kelly
Daniel Keep wrote: Sean Kelly wrote: Jason House wrote: Jason House wrote: Tango's GC (and therefore druntime's GC) has an explicit notification mechanism. I guess I shouldn't have assumed that the features of tango became part of druntime. I don't see any notification mechanism :( Same a

Re: Fully dynamic d by opDotExp overloading

2009-04-20 Thread Andrei Alexandrescu
Andrei Alexandrescu wrote: Steven Schveighoffer wrote: Haven't used D2 for much stuff, but does this work? I remember reading something about partial IFTI, so if you have opDotExp(string fname, T...) (T args){} and you call opDotExp!("b")(c, d, e) Does it implicitly define T? -Steve It

Re: Fully dynamic d by opDotExp overloading

2009-04-20 Thread Andrei Alexandrescu
Steven Schveighoffer wrote: Haven't used D2 for much stuff, but does this work? I remember reading something about partial IFTI, so if you have opDotExp(string fname, T...) (T args){} and you call opDotExp!("b")(c, d, e) Does it implicitly define T? -Steve It should, but there's a bug re

Re: Fully dynamic d by opDotExp overloading

2009-04-20 Thread Michel Fortin
On 2009-04-20 07:25:43 -0400, Christopher Wright said: BCS wrote: Hello Christopher, The utility is when you are looking for methods to invoke via runtime reflection, you can determine that a given function is one of these runtime opDotExp equivalents. So it is being argued that there shou

Re: Fully dynamic d by opDotExp overloading

2009-04-20 Thread Steven Schveighoffer
On Mon, 20 Apr 2009 09:47:53 -0400, Andrei Alexandrescu wrote: Steven Schveighoffer wrote: On Mon, 20 Apr 2009 06:54:21 -0400, Denis Koroskin <2kor...@gmail.com> wrote: On Mon, 20 Apr 2009 06:09:28 +0400, Steven Schveighoffer wrote: Yes, there are many things that opDotExp can do tha

Re: Fully dynamic d by opDotExp overloading

2009-04-20 Thread Andrei Alexandrescu
Steven Schveighoffer wrote: On Mon, 20 Apr 2009 06:54:21 -0400, Denis Koroskin <2kor...@gmail.com> wrote: On Mon, 20 Apr 2009 06:09:28 +0400, Steven Schveighoffer wrote: Yes, there are many things that opDotExp can do that opDot or alias this (which is essentially opDot without any code).

Re: Fully dynamic d by opDotExp overloading

2009-04-20 Thread Steven Schveighoffer
On Mon, 20 Apr 2009 06:54:21 -0400, Denis Koroskin <2kor...@gmail.com> wrote: On Mon, 20 Apr 2009 06:09:28 +0400, Steven Schveighoffer wrote: Yes, there are many things that opDotExp can do that opDot or alias this (which is essentially opDot without any code). Hooking every function

Re: Fully dynamic d by opDotExp overloading

2009-04-20 Thread Christopher Wright
BCS wrote: Hello Christopher, The utility is when you are looking for methods to invoke via runtime reflection, you can determine that a given function is one of these runtime opDotExp equivalents. So it is being argued that there should be a standard way to do a run time function invocation

Re: Fully dynamic d by opDotExp overloading

2009-04-20 Thread Denis Koroskin
On Mon, 20 Apr 2009 06:09:28 +0400, Steven Schveighoffer wrote: Yes, there are many things that opDotExp can do that opDot or alias this (which is essentially opDot without any code). Hooking every function call on a type seems to be one of the two killer use cases of this feature (the o

Re: Fully dynamic d by opDotExp overloading

2009-04-20 Thread BCS
Hello Yigal, I was meaning static as in "static if". I agree with what you've written here. I think my point in this sub-thread is a bit side-tracked from the main topic. there seems to be a lot of that in this thread again, what you said is correct, but since in our example we are discussin