December 25, 2009
Walter Bright wrote:
> grauzone wrote:
>>> It matters because Java is used a lot in multithreaded applications, and it is gc based. The gc is not a disastrous problem with it.
>>
>> For one, Java has an infinitely better GC implementation than D. Yeah, this isn't a problem with the concept or the language specification, but it matters in reality.
> 
> I thought we were talking about a fundamental issue of concept and language specification.

Yes, but what matters is what finally can be implemented. And my initial question was what advantages immutability would offer. Of course that includes the implementation, not only theoretical possibilities. Actually, I couldn't care less about theory. The question is: will this and that be implemented in a foreseeable time?

Those concepts and the limits of the implementation environment both set the frame of what will actually be possible. For example, saying D could just use the same GC algorithms as Java probably isn't going to work, because D has to deal with C compatibility, doesn't use a VM, etc... In the same way, thread local data by default and having a different set of shared types may provide some implementation opportunities that wouldn't exist in Java.

> 
>> There's no way a shared GC is ever going to be scalable with multicores. If I'm wrong and it can be made scalable, I'd like to see it. Not just in theory, but in D.
> 
> I believe there's plenty that can be achieved with it first. D has a fairly simple GC implementation in it right now, probably early 90's technology. It could be pushed an awful lot further.
> 
> If you want to help out with it, you're welcome to.

I sure would if I could, because GC performance gets on my nerves. Also I believe there are reasons why anyone didn't contribute a better GC yet. For one, most extended GC algorithms seem to require compiler support (precise type information, write barriers). And then D is bound to C, which complicates things further.

By the way how is dsimcha's precise GC patch coming?
December 25, 2009
On 12/25/2009 08:17 PM, Walter Bright wrote:
> I believe there's plenty that can be achieved with it first. D has a
> fairly simple GC implementation in it right now, probably early 90's
> technology. It could be pushed an awful lot further.
>
> If you want to help out with it, you're welcome to.

How about a simple way to allocate in TLS? Could be a garbage collected heap, which stops only the current thread when collecting.

It doesn't need to be an all out solution, and you could just advise against casting the pointers away from TLS, just as is done with immutability.

Then again, I have not measured the performance differences involved in the current solution, maybe this is a non-problem.
Next ›   Last »
1 2 3 4 5 6 7 8
Top | Discussion index | About this forum | D home