[phobos] Gcx: Would we ever want more than one?
Sean Kelly
sean at invisibleduck.org
Mon May 16 11:17:00 PDT 2011
On May 14, 2011, at 7:09 PM, Brad Roberts wrote:
> On 5/14/2011 7:02 PM, David Simcha wrote:
>> On 5/14/2011 8:28 PM, Sean Kelly wrote:
>>> Technically, you want a free list per core. I don't know how practical it is to figure that out though.
>>>
>>> Sent from my iPhone
>>>
>>> On May 12, 2011, at 8:14 PM, David Simcha<dsimcha at gmail.com> wrote:
>>
>> The idea being that, if you have a free list per core, there will almost never be any contention in practice, even if
>> you have way more threads than cores?
>
> Ideally neither contention nor cache swapping. It'd stay in the l1 or l2 of the core directly involved with the
> allocations. By being thread centric even if not contended it could still wander between cores and thus the caches
> associated with them.
>
> A serious micro-optimization, but..
I mentioned it mostly because it seemed an option worth exploring if a free list per thread turned out to be very difficult for some reason. A fixed array of free lists, one per core, would be easy if there were a way to determine which core the caller was being executed by. We may have to figure out the per-thread stuff anyway though, since non-shared data needs to be finalized by its owner thread. Again, this could be done by the owner core instead, but only if we could ensure that threads don't move between cores.
More information about the phobos
mailing list