The GC and performance, but not what you expect
Walter Bright via Digitalmars-d
digitalmars-d at puremagic.com
Thu May 29 12:00:25 PDT 2014
On 5/29/2014 4:01 AM, Robert Schadek via Digitalmars-d wrote:
> On 05/29/2014 12:41 PM, Jacob Carlborg via Digitalmars-d wrote:
>> On 2014-05-29 12:09, Atila Neves wrote:
>>
>>> The GC is preventing me from beating Java, but not because of
>>> collections. It's the locking it does to allocate instead! I
>>> don't know about the rest of you but I definitely didn't see that
>>> one coming.
>>
>> Doesn't the runtime know how many threads currently exist? If it's
>> only one, could the GC avoid the locking?
>>
> properly, but collections is not atomar and you have to prevent threads
> that are created during collection from collecting. so you still need to
> lock
If it's single threaded, and the single thread is doing the collecting, who is
starting up a new thread?
More information about the Digitalmars-d
mailing list