digitalmars.D.announce - GSoC 2016 - Precise GC
- Jeremy DeHaan (17/17) May 02 2016 Hi everyone!
- Yura Sokolov (4/9) May 02 2016 Great! That is what should have been done long time ago.
- Jeremy DeHaan (6/17) May 03 2016 I agree, but a precise heap scan should be the easiest part of
- Jack Stouffer (4/9) May 03 2016 I don't remember all the details, but I'm pretty sure that
- jmh530 (3/6) May 03 2016 Discussed in this thread (among others)
- Jeremy DeHaan (8/17) May 03 2016 I am reading a paper on how one could use extra information about
- jmh530 (3/10) May 03 2016 Does it matter that @safe code does not allow unions of pointers
- Jeremy DeHaan (6/18) May 03 2016 I'm not sure, but one would thing that @safe code wouldn't need
- jmh530 (5/10) May 04 2016 You can identify safe functions with
- Jeremy DeHaan (6/17) May 05 2016 All I meant was that I don't know enough about what the compiler
- Dmitry Olshansky (5/22) May 06 2016 I'd note that a union without pointers doesn't hurt precise scanner,
- Steven Schveighoffer (5/26) May 06 2016 Ones that have only pointers are probably OK too. Though I'm not sure if...
- deadalnix (3/40) May 08 2016 Because of void* and classes, the GC MUST be able to find out
- thedeemon (10/19) May 08 2016 Yep, and it does that by looking at metadata of the pointed
- Pham (11/29) May 08 2016 Union is an user-defined-kind value and only user codes can tell
- Leandro Lucarella (3/6) May 06 2016 And the stack, and the CPU registers, but yeah, it should be a
- Dsby (2/7) May 03 2016 Great!
Hi everyone! I'm a little late to the party as far as my announcement goes, but I have been busy reading code and doing research for my project. I was selected for this year's GSoC to implement a Precise GC, but I'm also planning to remove the lock on allocations as outlined in my proposal: https://drive.google.com/file/d/0B-UTFTbYro4vV0ljMUlSTEc2eEU/view?usp=sharing My repository for the code can be found here: https://github.com/Jebbs/druntime I will be posting of my progress in this thread throughout the course of the summer, but right now I am mainly focusing on familiarizing myself with all of the GC code since there is quite a lot of it. You will probably see me pushing some updates to documentation between now and when GSoC officially starts, but I hope to have already started making progress before then. I'll do my best to not let you all down!
May 02 2016
On Monday, 2 May 2016 at 15:29:15 UTC, Jeremy DeHaan wrote:Hi everyone! I'm a little late to the party as far as my announcement goes, but I have been busy reading code and doing research for my project. [...]Great! That is what should have been done long time ago. I'm pretty sure, if you implement just precise heap scan (and lock removal), it will be already huge win.
May 02 2016
On Tuesday, 3 May 2016 at 06:23:51 UTC, Yura Sokolov wrote:On Monday, 2 May 2016 at 15:29:15 UTC, Jeremy DeHaan wrote:I agree, but a precise heap scan should be the easiest part of this project. Rainer Schuetze has already implemented this and presented it at a dconf a few years ago(2013?). My plan is to use that since I know it works, and that frees up my time to focus on pretty much everything else.Hi everyone! I'm a little late to the party as far as my announcement goes, but I have been busy reading code and doing research for my project. [...]Great! That is what should have been done long time ago. I'm pretty sure, if you implement just precise heap scan (and lock removal), it will be already huge win.
May 03 2016
On Tuesday, 3 May 2016 at 16:15:27 UTC, Jeremy DeHaan wrote:I agree, but a precise heap scan should be the easiest part of this project. Rainer Schuetze has already implemented this and presented it at a dconf a few years ago(2013?). My plan is to use that since I know it works, and that frees up my time to focus on pretty much everything else.I don't remember all the details, but I'm pretty sure that Rainer, or maybe someone else, was talking about how a precise GC is not completely possible in D because D has unions.
May 03 2016
On Tuesday, 3 May 2016 at 16:44:32 UTC, Jack Stouffer wrote:I don't remember all the details, but I'm pretty sure that Rainer, or maybe someone else, was talking about how a precise GC is not completely possible in D because D has unions.Discussed in this thread (among others) http://forum.dlang.org/thread/bzcatcalqsxqvptxlppx forum.dlang.org
May 03 2016
On Tuesday, 3 May 2016 at 16:44:32 UTC, Jack Stouffer wrote:On Tuesday, 3 May 2016 at 16:15:27 UTC, Jeremy DeHaan wrote:I am reading a paper on how one could use extra information about what was last assigned to a union in order to scan them precisely. I haven't read the whole thing yet, but it looks like it could be done. Not sure if it is something I can get to in the course of my project though. Scanning only unions conservatively is still pretty good.I agree, but a precise heap scan should be the easiest part of this project. Rainer Schuetze has already implemented this and presented it at a dconf a few years ago(2013?). My plan is to use that since I know it works, and that frees up my time to focus on pretty much everything else.I don't remember all the details, but I'm pretty sure that Rainer, or maybe someone else, was talking about how a precise GC is not completely possible in D because D has unions.
May 03 2016
On Tuesday, 3 May 2016 at 18:15:20 UTC, Jeremy DeHaan wrote:I am reading a paper on how one could use extra information about what was last assigned to a union in order to scan them precisely. I haven't read the whole thing yet, but it looks like it could be done. Not sure if it is something I can get to in the course of my project though. Scanning only unions conservatively is still pretty good.Does it matter that safe code does not allow unions of pointers and non-pointers?
May 03 2016
On Tuesday, 3 May 2016 at 19:05:22 UTC, jmh530 wrote:On Tuesday, 3 May 2016 at 18:15:20 UTC, Jeremy DeHaan wrote:I'm not sure, but one would thing that safe code wouldn't need any extra information about the union. I wouldn't know how to differentiate between them though during runtime. Probably someone with more experience with the compiler would know more about that kind of thing.I am reading a paper on how one could use extra information about what was last assigned to a union in order to scan them precisely. I haven't read the whole thing yet, but it looks like it could be done. Not sure if it is something I can get to in the course of my project though. Scanning only unions conservatively is still pretty good.Does it matter that safe code does not allow unions of pointers and non-pointers?
May 03 2016
On Wednesday, 4 May 2016 at 02:50:08 UTC, Jeremy DeHaan wrote:I'm not sure, but one would thing that safe code wouldn't need any extra information about the union. I wouldn't know how to differentiate between them though during runtime. Probably someone with more experience with the compiler would know more about that kind of thing.You can identify safe functions with https://dlang.org/phobos/std_traits.html#isSafe or https://dlang.org/phobos/std_traits.html#functionAttributes
May 04 2016
On Wednesday, 4 May 2016 at 12:42:30 UTC, jmh530 wrote:On Wednesday, 4 May 2016 at 02:50:08 UTC, Jeremy DeHaan wrote:All I meant was that I don't know enough about what the compiler does with built in types to make this work. It almost sounds like we would need a safe union and unsafe union type and do some extra stuff for the unsafe union, but I'm just starting to learn about this stuff.I'm not sure, but one would think that safe code wouldn't need any extra information about the union. I wouldn't know how to differentiate between them though during runtime. Probably someone with more experience with the compiler would know more about that kind of thing.You can identify safe functions with https://dlang.org/phobos/std_traits.html#isSafe or https://dlang.org/phobos/std_traits.html#functionAttributes
May 05 2016
On 06-May-2016 05:37, Jeremy DeHaan wrote:On Wednesday, 4 May 2016 at 12:42:30 UTC, jmh530 wrote:I'd note that a union without pointers doesn't hurt precise scanner, it's only the ones with pointers that are bad. -- Dmitry OlshanskyOn Wednesday, 4 May 2016 at 02:50:08 UTC, Jeremy DeHaan wrote:All I meant was that I don't know enough about what the compiler does with built in types to make this work. It almost sounds like we would need a safe union and unsafe union type and do some extra stuff for the unsafe union, but I'm just starting to learn about this stuff.I'm not sure, but one would think that safe code wouldn't need any extra information about the union. I wouldn't know how to differentiate between them though during runtime. Probably someone with more experience with the compiler would know more about that kind of thing.You can identify safe functions with https://dlang.org/phobos/std_traits.html#isSafe or https://dlang.org/phobos/std_traits.html#functionAttributes
May 06 2016
On 5/6/16 11:06 AM, Dmitry Olshansky wrote:On 06-May-2016 05:37, Jeremy DeHaan wrote:Ones that have only pointers are probably OK too. Though I'm not sure if a precise scanner takes into account the type of the pointer. I would expect it to use embedded typeinfo in target block. -SteveOn Wednesday, 4 May 2016 at 12:42:30 UTC, jmh530 wrote:I'd note that a union without pointers doesn't hurt precise scanner, it's only the ones with pointers that are bad.On Wednesday, 4 May 2016 at 02:50:08 UTC, Jeremy DeHaan wrote:All I meant was that I don't know enough about what the compiler does with built in types to make this work. It almost sounds like we would need a safe union and unsafe union type and do some extra stuff for the unsafe union, but I'm just starting to learn about this stuff.I'm not sure, but one would think that safe code wouldn't need any extra information about the union. I wouldn't know how to differentiate between them though during runtime. Probably someone with more experience with the compiler would know more about that kind of thing.You can identify safe functions with https://dlang.org/phobos/std_traits.html#isSafe or https://dlang.org/phobos/std_traits.html#functionAttributes
May 06 2016
On Friday, 6 May 2016 at 09:31:08 UTC, Steven Schveighoffer wrote:On 5/6/16 11:06 AM, Dmitry Olshansky wrote:Because of void* and classes, the GC MUST be able to find out what type was actually allocated, or at least its pointer bitmask.On 06-May-2016 05:37, Jeremy DeHaan wrote:Ones that have only pointers are probably OK too. Though I'm not sure if a precise scanner takes into account the type of the pointer. I would expect it to use embedded typeinfo in target block. -SteveOn Wednesday, 4 May 2016 at 12:42:30 UTC, jmh530 wrote:I'd note that a union without pointers doesn't hurt precise scanner, it's only the ones with pointers that are bad.On Wednesday, 4 May 2016 at 02:50:08 UTC, Jeremy DeHaan wrote:All I meant was that I don't know enough about what the compiler does with built in types to make this work. It almost sounds like we would need a safe union and unsafe union type and do some extra stuff for the unsafe union, but I'm just starting to learn about this stuff.I'm not sure, but one would think that safe code wouldn't need any extra information about the union. I wouldn't know how to differentiate between them though during runtime. Probably someone with more experience with the compiler would know more about that kind of thing.You can identify safe functions with https://dlang.org/phobos/std_traits.html#isSafe or https://dlang.org/phobos/std_traits.html#functionAttributes
May 08 2016
On Sunday, 8 May 2016 at 11:16:56 UTC, deadalnix wrote:Yep, and it does that by looking at metadata of the pointed object itself, it doesn't care about the type of pointer to that object. I mean if we have object x of class X in heap and pointers "X p1", "void* p2" and "Y p3" all having same value &x (pointing to the same address) then GC will have no problem in scanning x as long as it can access x's type info knowing the address of x in heap. Which means all p1, p2 and p3 might easily be just at one position in a union and that would not be a problem.Ones that have only pointers are probably OK too. Though I'm not sure if a precise scanner takes into account the type of the pointer. I would expect it to use embedded typeinfo in target block. -SteveBecause of void* and classes, the GC MUST be able to find out what type was actually allocated, or at least its pointer bitmask.
May 08 2016
On Friday, 6 May 2016 at 09:06:59 UTC, Dmitry Olshansky wrote:On 06-May-2016 05:37, Jeremy DeHaan wrote:Union is an user-defined-kind value and only user codes can tell the difference. I believe this will also effect the reference count implementation. I suggest that when a type has a union member, it should create a function such as gcValues with a parameter of output range of record (offset: size_t, type: typeid). the function should return that info based on whatever the actual value of those pointer types. If that function is missing, use conservative approach as before Cheers PhamOn Wednesday, 4 May 2016 at 12:42:30 UTC, jmh530 wrote:I'd note that a union without pointers doesn't hurt precise scanner, it's only the ones with pointers that are bad.On Wednesday, 4 May 2016 at 02:50:08 UTC, Jeremy DeHaan wrote: You can identify safe functions with https://dlang.org/phobos/std_traits.html#isSafe or https://dlang.org/phobos/std_traits.html#functionAttributesAll I meant was that I don't know enough about what the compiler does with built in types to make this work. It almost sounds like we would need a safe union and unsafe union type and do some extra stuff for the unsafe union, but I'm just starting to learn about this stuff.
May 08 2016
On Tuesday, 3 May 2016 at 18:15:20 UTC, Jeremy DeHaan wrote:Not sure if it is something I can get to in the course of my project though. Scanning only unions conservatively is still pretty good.And the stack, and the CPU registers, but yeah, it should be a minority.
May 06 2016
On Monday, 2 May 2016 at 15:29:15 UTC, Jeremy DeHaan wrote:Hi everyone! I'm a little late to the party as far as my announcement goes, but I have been busy reading code and doing research for my project. [...]Great!
May 03 2016