[fpc-devel] Re: Compiler bottlenecks
florian at freepascal.org
Thu Jul 15 18:44:36 CEST 2010
>> The FastMM4 uses a LOCKed asm instruction for every memory allocation
> or dis-allocation. This LOCK ensure that a memory is modified by only a
> thread at a time. This is the same LOCKed asm function which is used
> internally by Windows with its Critical Sections. Windows itself is told
> not to be very multi-core friendly, because it does use a lot of
> critical sections in its internal... Linux is much more advanced, and
> scales pretty well on massive multi-core architectures.
>> On a multi-core CPU, all cores just freeze in order to make this
> LOCKed asm function threadsafe. If you have a lot of threads with more
> than one CPU, the context of every CPU core has to be frozen, cleared,
> all cores wait for the LOCKed asm instruction to complete, then the
> context is to be retrieved, and execution continue.
This is not true since at least Pentium Pro times. A lock prefix causes
no bus lock anymore but only a cache lock.
More information about the fpc-devel