Re:Rust for C++ programmers – part 4: unique pointers
by loup-vaillant on Tuesday April 29, 2014 @11:33AM
(#7667661)
I'm not sure. If you start using smart pointers in C++, you can get the same problem: instead of a GC pause, you get a cascading delete pause. To eliminate it, you have to devise a smarter memory scheme, at which point you probably don't underestimate the determinism cap.
Also don't forget that garbage collectors can often be tuned. Granted, many of them suck, but a generational, incremental collector whose parameters can be tweaked? Much less room for pauses.
Re:Rust for C++ programmers – part 4: unique pointers
by pohl on Tuesday April 29, 2014 @12:18PM
(#7668008)
A cascading delete pause may be undesirable, but is it nondeterministic?
Re:Rust for C++ programmers – part 4: unique pointers
by jerf on Tuesday April 29, 2014 @12:28PM
(#7668061)
In the same way that GC is, yes. Technically both are probably fully deterministic, just not readily determinable by casual examination of the code at compile time.
Re:Rust for C++ programmers – part 4: unique pointers
by pohl on Tuesday April 29, 2014 @12:35PM
(#7668121)
I guess I didn't mean nondeterministic in the philosophical indeterminism sense, but in the sense that different runs might produce different behavior.
Re:Rust for C++ programmers – part 4: unique pointers
by loup-vaillant on Tuesday April 29, 2014 @08:21PM
(#7670816)
Well, you can get there if you lag enough to drop a few frames in a competitive FPS game: while the game is still deterministic, the game/players system will diverge: a few dropped frames can get you fragged.
Also, some naive simulations will adapt the length of their steps with the time it takes to compute them. Any performance variation gives you full blown unpredictability.
Re:Rust for C++ programmers – part 4: unique pointers
by AnimalMuppet on Tuesday April 29, 2014 @12:59PM
(#7668294)
Even a single delete/free is nondeterministic. How long it takes depends on the state of the heap (true of new/malloc as well).
Re:Rust for C++ programmers – part 4: unique pointers
by rdtsc on Tuesday April 29, 2014 @12:53PM
(#7668251)
Very good point. Performance folds in latency (determinism) and throughput. There is usually a trade-off between the two. GC might handle throughput reasonably, latency is a bit tougher. You are sort of left tweaking knobs on a black box hoping to get good results in the end.
I think you're right about that, but I also think that people greatly underestimate the determinism gap between them, too. (Not necessarily the same set of people, of course.)