1 Buscar a Kyle y sean_k en #d o #d.tango
2 =======================================
7 <luca_work> sean_k, my name is Leandro Lucarella, I'm starting my grade
8 thesis on garbage collection and I'm planning to do it in the
9 context of D, so I was asking what's the relation between Tango
11 <luca_work> I'm in an early stage of research, so any (basic) information
12 about how D is doing GC is welcome
13 <sean_k> Tango is effectively a replacement for Phobos, so it contains
14 language runtime code and a garbage collector, equivalent to
15 what's in phobos/internal and phobos/internal/gc.
16 <sean_k> Tango, however, splits the functionality out into separate
17 components, so you can swap in a different GC implementation at
18 application link-time. The defult Tango GC is a modified
19 version of the one in Phobos.
20 <luca_work> so the GC of D lives in phobos and it's completely implemented
23 <sean_k> The D GC was written by Walter. It's a mark/sweep garbage
24 collector. Basically, if new called and the GC doesn't have any
25 memory available then it runs a collection and checkts its pool
26 again. If there still isn't enough memory for the operation
27 then it will allocate a new page from the OS via mmap (Posix) or
28 VirtualAlloc (Windows).
30 <luca_work> so there's is no support from the compiler (I mean, the GC just
31 uses the regular compiler features, there are no compiler
33 <sean_k> Not really, no. The only compiler "hooks" are simply the calls
34 that forward "new" and "delete" to internal functions.
36 <luca_work> Is there any good source about the D runtime? I mean, what is
37 done until you get to the D main()? Like who and when the GC is
39 <sean_k> There's no documentation for that, but in Phobos the startup code
40 is in internal/dmain2.d. Before D main is entered, all static
41 module ctors in the app will be run, and unit tests as well if
42 -unittest was specified at the command-line. Other than that,
43 the garbage collector and thread code is initialized.
44 <sean_k> The GC is initialized via a call to gc_init(), and it in turn
45 initializes the thread code via thread_init() (I think).
46 <sean_k> The GC is required to initialize the thread code because it relies
47 on the thread code for portions of its collection phase. First,
48 it suspends all running threads, then it scans each of their
49 stacks, then it resumes the threads. The thread code is
50 responsible for suspending and resuming threads and for telling
51 the GC where each stack is.
57 >Ok, I'll search the net. May I ask how did you learn how to hack gcc to
61 I started reading the internals guide
62 (http://gcc.gnu.org/onlinedocs/gccint/), but that was very
63 incomplete/misleading/out of date. My other major source was the GNU
64 Pascal compiler sources. Beyond that, it was mostly analyzing the GCC
65 source and trail-and-error.
67 Quejas sobre el GC de D:
68 ========================
69 The problem with the D GC:
70 http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=46407
72 Full Reflection Gets You Smarter GC:
73 http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=44607
75 shootout.binarytrees when implemented with gc is 10x slower than C# on .NET 2.0:
76 http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=43991
78 Is a moving GC really needed?:
79 http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=42557
81 GC, the simple solution (propuesta de reference counting, son sus problemas):
82 http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=38689
84 GC implementation (problemas de seguridad de GC conservativo):
85 http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=35364
87 How does RTTI help gc?:
88 http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=29291
90 thread and gc.fullCollect (bug en GC?):
91 http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.learn&article_id=5821
93 Transitioning to a type aware Garbage Collector:
94 http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.announce&article_id=6842
97 http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.learn&article_id=5821
100 Programas que rompen (rompían) el GC:
101 http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=46407
102 http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.announce&article_id=6978
103 http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=54084
104 http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=56261
106 Compile-time compiler:
107 http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=49164
110 Más problemas de performance del GC de D (comparado con java6 en el shootout):
111 http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=62369