Opened 15 years ago

Closed 15 years ago

#183 closed defect (fixed)

Userspace heap allocator is not thread safe

Reported by: Jakub Jermář Owned by:
Priority: major Milestone: 0.4.3
Component: helenos/lib/c Version: mainline
Keywords: Cc:
Blocker for: Depends on:
See also:

Description

The userspace heap allocator is not thread safe. At least I can't see any protection of the heap state variables such as heap_pages and heap_end.

Change History (2)

comment:1 by Martin Decky, 15 years ago

The observation that the heap allocator is not thread safe is completely correct. However, I am not sure whether the standard malloc() and free() functions are defined to be thread safe by the C specification.

There are two basic solutions:

  • Keep malloc() and free() as they are and introduce a new thread safe API based on them.
  • Make malloc() and free() thread safe by themselves, possibly deviating slightly from common practice (but anyway it is not a major deviation).

comment:2 by Martin Decky, 15 years ago

Resolution: fixed
Status: newclosed

The academical dilemma was solved by brute force. As of changeset head,370 malloc() and free() are thread-safe by default.

Note: See TracTickets for help on using tickets.