OSNews article about C++09 degenerates into C++ vs. D discussion
Sean Kelly
sean at f4.ca
Mon Nov 20 09:50:37 PST 2006
Miles wrote:
>
> As for synchronization, I think this is more a problem when GC is used
> than when it is not. Malloc-based allocation needs synchronization, of
> course, but I think GC-based does also.
Theoretically, neither require synchronization so long as they maintain
per-thread heaps. The obvious consequence being a greater amount of
unused memory in the application. GC collection obviously requires
synchronization however.
> Deallocation is very atomic and
> can be implemented without synchronization and still be thread-safe.
> GC-based, OTOH, needs to freeze the whole application (not just the
> threads doing allocation) in order to collect.
Yup. There are GC designs which do not require this, but they don't
seem terribly compatible with D. Instead, the focus is more on
minimizing the time that any "stop the world" phase requires. There are
a bunch of different GC designs and refinements to accomplish this, and
I expect we will see more of them as D matures.
Sean
More information about the Digitalmars-d
mailing list