News for hackers. Stuff that matters.
Re:Go’s march to low-latency GC by astrange on Wednesday July 06, 2016 @04:27PM (#12045676)
Does Java still have a word in every object allocation for locking it? Adding a 64-bit pointer sounds terribly inefficient.

Did you know Objective-C does locks and retain counting without allocating any extra fields in objects?

Re:Go’s march to low-latency GC by sbanach on Wednesday July 06, 2016 @05:56PM (#12046133)
On hotspot: There are two bits in the header of every object. This is enough for an object that's never been used as a contended lock, CAS operations on the header can be used to handle the locking and that's that. As soon as you actually block on it, a 'real' lock is created (you can't get around the need for a list of threads to wake up as the lock is released) and the header grows to accomodate it. The process is called 'monitor inflation'. At a later date this might be cleaned up by a 'monitor deflation'.