News for hackers. Stuff that matters.
Re:Chris Lattner on garbage collection vs. Automatic Referen... by tialaramex on Monday April 25, 2022 @01:45PM (#31158261)
> now I see I have spelled thin as 'thing' which is a definite mistake on my part

That does make a lot more sense. I agree that what's going on here is not merely a thin wrapper.

> My point has always been that locks/monitors/semaphores/etc. dont need any special care in a GC-setup as they can be implemented purely in the language itself

And my point was always that you can only depend upon this if you in fact are always using the "implemented purely in the language itself" mechanisms, while plenty of others exist and you might need them - but you can't just treat them as garbage safely.

So overall I think we were mostly talking at cross purposes.

Actually looking at the Java stuff reminded me of m_ou_se's thread about how big boost::shared_mutex is (it's 312 bytes). Most people who need one of these synchronization primitives only really need the one that costs 4 bytes, but it's hard to keep saying "No" to people who want to add features. They're always confident that everybody will love their feature, at the cost of a little more memory, and it spirals out of control.

On most systems the pthread_mutex_t you mentioned is already 40 bytes. A "nightly" Rust can do a 32-byte array with a mutex to protect it, all inside 40 bytes.

There are no comments on this comment yet.