4 ms·
Sure, I don't like handling input or strings in C. But as the author notes, it's good for datastructures. Some, like his Trie, just can't be optimized or don
by mattpallissard 4y ago
Sure, I don't like handling input or strings in C. But as the author notes, it's good for datastructures. Some, like his Trie, just can't be optimized or done sanely without a language that supports pointers. Additionally, if you're writing in a *nix system you have all the Posix man pages at your fingertips.
Not exactly C specific, but I sure don't like reasoning about memory or compiler barriers like his shared memory example. Footguns galore.
Footnote on barriers;
The gcc extensions he was using; https://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html https://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins..., https://gcc.gnu.org/wiki/Atomic/GCCMM/AtomicSync https://gcc.gnu.org/wiki/Atomic/GCCMM/AtomicSync
The kernel documentation naturally has different semantics and barriers available to it, but the behavior of compilers and cpu pipelining is documented well; https://www.kernel.org/doc/html/latest/staging/index.html#memory-barriers https://www.kernel.org/doc/html/latest/staging/index.html#me...
Edit, footnote, formatting, link
- jefftk 4y ago> I sure don't like reasoning about memory or compiler barriers like his shared memory example. Footguns galore. I agree it's easy to screw this part up, but if you get it right the performance is far better than any of the other options.