Opened 16 years ago
Closed 16 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 , 16 years ago
comment:2 by , 16 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
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.

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: