News for hackers. Stuff that matters.
Re:RE#: how we built the fastest regex engine in F# by layer8 on Wednesday March 04, 2026 @02:59PM (#47252979)
> Multithreading is generally a non-issue, you just wrap the function that creates the state behind a lock/mutex, this is usually the default.

But you also have to lock when reading the state, not just when writing/creating it. Wouldn’t that cause lock contention with sufficiently concurrent use?

Re:RE#: how we built the fastest regex engine in F# by ieviev on Wednesday March 04, 2026 @03:44PM (#47253514)
No, we do not lock reading the state, we only lock the creation side and the transition table reference stays valid during matching even if it is outdated.

Only when a nonexistent state is encountered during matching it enters the locked region.

Re:RE#: how we built the fastest regex engine in F# by layer8 on Wednesday March 04, 2026 @04:39PM (#47254294)
Ah, I see, so it’s basically the Racy Single-Check Idiom.