How to write a thread-safe and efficient, lock-free memory allocator in C?

前端 未结 3 925
伪装坚强ぢ
伪装坚强ぢ 2021-01-31 12:30

How to write a thread-safe and efficient, lock-free memory allocator in C? By efficient I mean:

  1. Fast allocation & deallocation

  2. Optimal memor

3条回答
  •  醉酒成梦
    2021-01-31 13:17

    http://www.research.ibm.com/people/m/michael/pldi-2004.pdf

    This paper presents a completely lock-free memory allocator. It uses only widely-available operating system support and hardware atomic instructions. It offers guaranteed availability even under arbitrary thread termination and crash-failure, and it is immune to dead-lock regardless of scheduling policies, and hence it can be used even in interrupt handlers and real-time applications without requiring special scheduler support. Also, by leveraging some high-level structures from Hoard, our allocator is highly scalable, limits space blowup to a constant factor, and is capable of avoiding false sharing...

提交回复
热议问题