News for hackers. Stuff that matters.
Re:Writing a Simple Garbage Collector in C by earenndil on Sunday December 15, 2019 @02:40AM (#21795011)
> None of this is thread-safe. It needs a global mutex lock.

Or have a separate allocation chain for each thread.

It would increase fragmentation, but not by a lot, and probably increase performance by more than enough to make up for it.

Re:Writing a Simple Garbage Collector in C by pcwalton on Sunday December 15, 2019 @03:21AM (#21795132)
The problem is that you would still need to lock around sbrk.
Re:Writing a Simple Garbage Collector in C by earenndil on Sunday December 15, 2019 @03:06PM (#21798628)
Fair enough. You would probably switch to mmap, though, which works across threads.