News for hackers. Stuff that matters.
Re:Designing a new concurrent data structure by jerrinot on Monday August 28, 2023 @11:14AM (#37295415)
Hello, the author here. It feels great to see my blog on HN!

It was quite a journey, at first I thought I invented a novel concurrency schema. However, it turns out that it was simply a mix of my ignorance and hubris! :-)

Still, I had a lot of fun while designing this data structure and I believe it made a nice story. Ask me anything!

Re:Designing a new concurrent data structure by impish9208 on Monday August 28, 2023 @07:49PM (#37301777)
How do you learn stuff like this? Especially the JNI and off-heap memory parts.
Re:Designing a new concurrent data structure by nextaccountic on Monday August 28, 2023 @09:03PM (#37302310)
If the keys are strings and you can use Rust, have you considered fst [0]? If the keys have prefixes in common, it is very compact. There's a blog post about it [1]

[0] https://github.com/BurntSushi/fst

[1] https://blog.burntsushi.net/transducers/

The main limitation of it is that it doesn't support removal, but if removals are infrequent you can workaround that with another fst with removed items (and periodically rebuild the whole thing)

Re:Designing a new concurrent data structure by porridgeandrice on Tuesday August 29, 2023 @04:38AM (#37304889)
Re:Designing a new concurrent data structure by nextaccountic on Tuesday August 29, 2023 @06:35AM (#37305644)
Yes the state machine data structure are also used in regex engines. The author of the fst crate also created Rust's regex crate and the ripgrep CLI tool.

The regex crate has multiple implementations of regex matching algorithms, which is exposed as a library [0]. The implementations are selected at runtime based on which is faster and works right for a given regex. See also [1]

[0] https://blog.burntsushi.net/regex-internals/

[1] https://docs.rs/regex-automata/latest/regex_automata/#availa...

Re:Designing a new concurrent data structure by burntsushi on Tuesday August 29, 2023 @07:31AM (#37306168)
Author of fst and regex crates here.

No, it isn't. The only similarity between them is finite state machines. Cox's article is about regexes. The fst crate is a data structure for storing keys and optional values. Two completely different things.