3 ms·
It's not a few dozen lines of code because of, among other things, the case in which one thread allocates a lot of memory that is then sent to another thread to
by pcwalton 3y ago
It's not a few dozen lines of code because of, among other things, the case in which one thread allocates a lot of memory that is then sent to another thread to be freed. This actually happens more frequently than you'd think, because of producer/consumer patterns. In that case stop-the-world synchronization must happen in order to re-balance the pools in order to avoid what are essentially memory leaks. This is complex and is actually fairly similar to garbage collection.
- kragen 3y agoaha, thanks. it's true that i was thinking that just adding it to the receiver thread's pool would be sufficient