DSTM and Memory Management in C
I figured out the problem... the thing is it seems that the solution won't be pretty.
The problem basically is that when I wrote the program to run in C, I had to manually manage memory. I thought about memory management as a single threaded thing, and it was working fine back then.
Now though, when the program is actually multi-threaded, different pointers are mingling and interacting in ways I didn't except, and to be honest, even now, I cannot see how to be able to forsee every possible interaction. Thus from the looks of it, it seems that I need to implement garbage collection.
Of course I'm not gonna write my own collector since that's an involved process. I found one developed by some people at HP which seems to be quiet a respectable GC:
http://www.hpl.hp.co.uk/personal/Hans_Boehm/gc/
So, what I'm going to do now is try to get my DSTM working with a garbace collector. Once I do that I will see if it's possible for me to get rid of the collector.
The problem basically is that when I wrote the program to run in C, I had to manually manage memory. I thought about memory management as a single threaded thing, and it was working fine back then.
Now though, when the program is actually multi-threaded, different pointers are mingling and interacting in ways I didn't except, and to be honest, even now, I cannot see how to be able to forsee every possible interaction. Thus from the looks of it, it seems that I need to implement garbage collection.
Of course I'm not gonna write my own collector since that's an involved process. I found one developed by some people at HP which seems to be quiet a respectable GC:
http://www.hpl.hp.co.uk/personal/Hans_Boehm/gc/
So, what I'm going to do now is try to get my DSTM working with a garbace collector. Once I do that I will see if it's possible for me to get rid of the collector.
0 Comments:
Post a Comment
<< Home