r/cpp • u/SatadeepDasgupta • Jul 03 '26
Windows doesn't have fork(), so I faked copy-on-write with VirtualProtect + exception handling to snapshot an in-memory KV store
0
Upvotes
r/cpp • u/SatadeepDasgupta • Jul 03 '26
View all comments
2
u/RogerV Jul 05 '26
The lack of a fork() equivalent on Windows has basically meant that some popular Unix tools end up being more of a pain to port over. One would prefer that a Posix compatibility layer for Windows could do the trick for the most part, but then there ends up being the pesky fork() call...
But frankly, my answer has been to just abandon Windows altogether as a place to do programming. Am not going to write a GUI app that I expect to run on Windows, and would not in a million years consider writing any server-side service that targets Windows. So it's not much of a sacrifice to merely ignore this OS.