Re: D2006 Hyperthreading Win32



Danijel Tkalcec [RTC] wrote:

> But, this isn't very problematic, even though one might think so.
> Critical sections are very often used in applications and the Win32
> API calls EnterCriticalSection/LeaveCriticalSection have well written
> by M$.
>
> In any case, most Memory Managers (including FastMM - which is the
> new default MM in D2006) have to do the same (use critical sections).

You're under-stating the problem with the old MM. FastMM uses separate
locks for small, medium, and large allocations. If a request is unable
to obtain a lock for the size it needs, it can try to obtain a lock for
a larger size before waiting. The old MM had only a single lock, so it
would *always* wait if another thread was working on an allocation.
It's not just locking /per se/ which hurts performance, but also the
granularity of the lock.

This sounds like it should result in a waste of memory, but other
optimizations (anti-fragmentation management) in the new MM offset that
in favor of the new MM.

Again, I don't think the old behavior has anything to do with what is
described in the top post, but I do think it's misleading to equate the
consequences of turning on multi-threaded mode in the old and new MMs.

--
Craig Stuntz [TeamB] · Vertex Systems Corp. · Columbus, OH
Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz
Useful articles about InterBase development:
http://blogs.teamb.com/craigstuntz/category/21.aspx
.



Relevant Pages

  • Re: [PATCH 2.6.18-rc4 00/10] Kernel memory leak detector 0.9
    ... events/0/8 is trying to acquire lock: ... The kmemleak+slab locking is a bit complicated because memleak itself ... pointer_cache and the radix_tree allocations). ... would lead to deadlock because of the recursive call into kmemleak. ...
    (Linux-Kernel)
  • Re: D2006 Hyperthreading Win32
    ... locks for small, medium, and large allocations. ... If a request is unable to obtain a lock for the size it needs, it can try to obtain a lock for a larger size before waiting. ...
    (borland.public.delphi.non-technical)
  • Re: Multithreaded GC!
    ... will share a heap across multiple threads, ... with "synchronize their allocations" though. ... synchronized using a lock. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Registry questions....
    ... allowed applications while not allowing unapproved applications (i.e. ... XP has the security built-in to do this, ... his/her PC using the Administrator account. ... I'm documenting how to lock things down using the built-in XP tools, ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Registry questions....
    ... allowed applications while not allowing unapproved applications (i.e. ... XP has the security built-in to do this, ... his/her PC using the Administrator account. ... I'm documenting how to lock things down using the built-in XP tools, ...
    (microsoft.public.windowsxp.general)