5 ms·
I wonder why it was only Rust or Go he considered. He could also use Java. It has a 'pauseless' GC in Fedora Core's OpenJDK (Shenandoah). It has an epoll abstr
by mike_hearn 10y ago
I wonder why it was only Rust or Go he considered.
He could also use Java. It has a 'pauseless' GC in Fedora Core's OpenJDK (Shenandoah). It has an epoll abstraction in the core library. It has libraries for doing things like async DNS requests already.
It would be nice sometimes if these A vs B comparisons were a bit wider.
- osi 10y agoJava would be disqualified due to GC: > It is worth noting that Go came nearest disqualifying itself entirely here. If it were not possible to lock out Go’s GC in critical regions Rust would win by default.
- jondumbau 10y agoWhat technique is used to lock the GC out?
- osi 10y agodunno- just copying what was in the original article :)
- baq 10y agoi'd guess a negative arg passed to https://golang.org/pkg/runtime/debug/#SetGCPercent https://golang.org/pkg/runtime/debug/#SetGCPercent
- cafxx 10y agoI hope not, because this way a critical section requires two non-concurrent GCs (SetGCPercent calls runtime.GC() [1] and runtime.GC() triggers a non-concurrent GC [2]). If this is the option, I hope the critical sections in ntpsec are few and far apart... [1] https://golang.org/src/runtime/debug/garbage.go?s=3706:3740#L87 https://golang.org/src/runtime/debug/garbage.go?s=3706:3740#... [2] https://golang.org/src/runtime/mgc.go?s=33685:33694#L844 https://golang.org/src/runtime/mgc.go?s=33685:33694#L844
- mike_hearn 10y agoI think the assumption is that, as ntpsec is "soft real time" i.e. not hard real time, sufficiently low pauses mean you wouldn't need to lock out the GC at all. I mean, technically anything the system or runtime does on your behalf can be thought of as a 'pause'. What if you lose your timeslice half way through a function?
- deleted 10y ago[deleted]
- tomp 10y agoIt's not pauseless. > Shenandoah is an ultra-low pause time garbage collector that reduces GC pause times by performing more garbage collection work concurrently with the running Java program Funny enough, the term "pauseless" was in fact invented precisely because of people like you, who abused the original terms ("concurrent" or "asynchronous" [0]) used for garbage collectors that never "stop the world", and used it for algorithms that merely run in parallel with the mutator threads, pausing them every so often. The next term used was "fully-concurrent" and now "pauseless". But if you keep abusing these terms to mean not fully pauseless/concurrent GCs, then it will become just as useless as all the terms before it. [0] http://gallium.inria.fr/~xleroy/publi/concurrent-gc.pdf http://gallium.inria.fr/~xleroy/publi/concurrent-gc.pdf
- Groxx 10y agoCalling a GC that does much of its work while not-blocking-your-code seems like an appropriate use of the word "concurrent". Concurrent almost never implies "will never block", as far as I've seen people use it. If anything, that would be a "lock-free concurrent GC" or something.
- thinkpad20 10y ago> the term "pauseless" was in fact invented precisely because of people like you, who abused the original terms This language seems unnecessarily personal and accusatory.
- nickik 10y agoThe question is what sort of pauses do you care about. I don't know about Shenandoah but the original Pauseless GC that Azul developed (and the current C4 on x86) have smaller GC pause times then thread switches. So, if you are operating in a environment where you don't care about thread switching, you might also not care about GC anymore. You are correct however, its not pauseless, that just a marketing term.
- tomp 10y agoAFAIK Azul is pauseless - it never "stops the world". Sure, it stops each thread (that's pretty much required for any synchronization mechanism, especially if you also need to determine the thread's roots), but it never stops all threads at once ("the world").
- detaro 10y agoDoes that run on all the BSDs and nicely on low-performance embedded ARM boards, which are explicitly targeted by NTPsec? Does it talk to low-level OS APIs for time management without complicated wrappers? It's a replacement for one of the many background UNIX services, not a "primary" service that can own a machine.
- empthought 10y agoYou know SIM cards run Java, right?
- detaro 10y agoThey run something called Java Card, which is a very limited subset of Java (missing things like threads, enums or floating point numbers). And they are highly standardized, so you can be sure it is not just available and supported, but optimized for running these applets. That doesn't really say anything about viability for an open-source project that's supposed to run on all kinds of embedded and general-purpose hardware.
- geodel 10y agoShenandoah has pause times ~10ms and is recommended for heaps 20GB+ for vs sub millisec in Go. NTPSec does not seem to have such high end memory requirements. Also now Java based app will need JVM availability on all platforms where NTPSec runs. I think sometimes it makes sense not to shove Java where it is not applicable. http://www.slideshare.net/RedHatDevelopers/shenandoah-gc-java-without-the-garbage-collection-hiccups-christine-flood http://www.slideshare.net/RedHatDevelopers/shenandoah-gc-jav...
- hnbro 10y agocan go (or rust) compile for targets that don't have a jvm?
- mixedCase 10y agoAs far as Go goes, I believe neither the Plan 9 OS nor the MIPS CPU architecture have a production-ready JVM. Go supports both.
- mike_hearn 10y agoYes, but that's because it's only really large heaps where pause times become problematic. On small heaps even dumb algorithms can give tiny pauses (a few msec or less) on modern hardware. It's true you'd need a JVM on the platforms where ntpsec runs but that's also true of having a port of the Go runtime.