Machine-translated by Google. Questions are authored in English.
Top

Discussion

A pool of fixed-size blocks is preferred to the heap for message buffers because

  • A.the pool needs no synchronisation between tasks
  • B.blocks from a pool need never be returned
  • C.allocation is constant-time and cannot fragment
  • D.the pool consumes less total memory than a heap would

Answer: C

Every block is the same size, so a free list gives allocation and release in a fixed few instructions with no possibility of fragmentation, which is exactly what a long-running system needs. It wastes memory whenever an item is smaller than the block, and that waste is the price of the determinism.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.