News for hackers. Stuff that matters.

cliffc

Re:Simple – Sea of Nodes on Saturday September 21, 2024 @07:59PM (#41613551)
C2/HotSpot uses a MemBarrier / MemFence node type for these. Serializes the memory ops as needed. Used to implement the Java memory model on all hardware. Sometimes (x86) the ops encode as (empty), sometimes its a Real Fence op.
Re:Simple – Sea of Nodes on Saturday September 21, 2024 @04:30PM (#41612487)
Simple (https://github.com/SeaOfNodes) is a compiler tutorial featuring the Sea-of-Nodes IR, with ports in Java (@cliffclick), Go (@yardenlaif), Rust (@RobertObkircher), and C++ (@Hels15), with help from @XmiliaH, @ThaliaArchi. If you'd like to help reach out to [email protected] or on GitHub.
Re:A JVM Does That? (2011) [pdf] on Saturday July 09, 2016 @12:01PM (#12061884)
It was cheaper to run (power, heat, space) than the equivalent pile of X86's of that era and for years to come. Each box cost between $250k and $750k depending on cores & memory. You didn't buy one unless you had a specific scaling problem that scale-out x86's weren't cutting it.
Re:A JVM Does That? (2011) [pdf] on Friday July 08, 2016 @12:42PM (#12056825)
I have board with 2 Vega chips in my living room - 24 cores each; each a full 64-bit RISC with 32 registers and ie754 FP math, read & write barriers in hardware; inline-cache virtual calls in hardware, and transactional memory. Later chip versions had 48 and then 54 cores, and you could jam 16 chips in a cache-coherent shared memory box - with top-10 supercomputer bandwidth. But you needed 54*16 parallel working threads to use it all. :-) Cliff
Re:Go’s march to low-latency GC on Friday July 08, 2016 @12:37PM (#12056783)
And the actual data is stored in giant byte[] (hidden behind the API), so the GC costs are near zero. Cliff
Re:Go’s march to low-latency GC on Friday July 08, 2016 @12:36PM (#12056777)
Fun stuff I've been doing with the H2O project is basically using nearly-pure Java (some Unsafe) to hold onto numbers with better efficiency than e.g. int[], and giving out an easy-enough-to-use API for writing parallel & distributed code over an Array-like API. i.e., feels "almost like an array", and "for-loops" run at memory bandwidth speeds and also parallel and distributed. Cliff
Re:Go’s march to low-latency GC on Friday July 08, 2016 @12:33PM (#12056744)
Nearly all the work you allude to is done in other threads - which indeed consume machine resources (CPU cycles, memory bandwidth). If your application does not burn all cores/bandwidth then the GC work is all done on the idle/spare machine resources. At the limit though, indeed you'll have to slow down the Application so that GC can play catchup - and bulk/batch stop-the-world style GC's require less overhead than the background incremental GCs Cliff
Re:Go’s march to low-latency GC on Friday July 08, 2016 @12:30PM (#12056721)
Sorta kinda all of the above. C4 the algo has no pauses, but individual threads stop to crawl their own stacks. i.e., threads stop doing mutator work, but only 1-by-1, and only for a very short partial self-stack crawl. C4 the impl I believe now has no pauses also. HotSpot the JVM has pauses, and yes much Zing was on forcing these pause times down. Cliff
Re:A JVM Does That? (2011) [pdf] on Friday July 08, 2016 @12:26PM (#12056702)
Azul hardware had a very large core count of low-performing cores. If you had enough parallelism then it was hard to beat - but most applications didn't have enough parallel work, so the market wasn't big enough
Re:A JVM Does That? (2011) [pdf] on Friday July 08, 2016 @12:24PM (#12056678)
No change to the X86, instead user-mode TLB handler from RedHat allows ptr-swizzeling, that plus some careful planning and the read barrier fell to 2 X86 ops - with acceptable runtime costs. Cliff
Re:A JVM Does That? (2011) [pdf] on Friday July 08, 2016 @12:18PM (#12056635)
Right when Java was taking off, there were a bunch of research proposals for better over-the-wire executable formats (mostly funded by microsoft). Designs where you could convert the bytecodes to machine code as fast as L1 could take it with sane 1st-level-JIT code quality. And also have safety, and enough type info the use a 2nd-level JIT for really hot code.
Re:A JVM Does That? (2011) [pdf] on Friday July 08, 2016 @01:16AM (#12053661)
The X86 memory model is "conservative" in the sense that it puts strong restrictions on the order of observed loads and stores between cores. Azul and IA64 did not. Hence "sloppy" code - but technically correct (at least it would compile) might run on an X86 and break on the IA64. Cliff
Re:A JVM Does That? (2011) [pdf] on Friday July 08, 2016 @01:13AM (#12053656)
It means what it says it means? "fragile" code is code that can't be touched because touching it causes it to "break" - exhibit bugs that can't easily be fixed. "fluffy" code is bulky code: code that says in 1000 lines what could better be said in 10 lines. Cliff
Re:A JVM Does That? (2011) [pdf] on Friday July 08, 2016 @01:10AM (#12053648)
Azul's GC required a read-barrier (some instructions to be executed on every pointer read) - which cost something like 5% performance on an X86. In exchange max GC pause time is something in the low microsecond range (I helped implement the Azul JVM and portions of the GC relating to starting and stopping threads)
Re:A JVM Does That? (2011) [pdf] on Friday July 08, 2016 @01:06AM (#12053643)
Thanks for the nod! Cliff