Get the latest tech news
Running a million-board chess MMO in a single process
How one million chessboards works
Moves are fed into a go channel (roughly a threadsafe queue), where a single writer validates them (making sure they follow chess rules), applies them, and distributes them to the relevant clients. To deal with this for One Million Chessboards, I use reservoir sampling (which I learned about from my friend Sam’s phenomenal blog post13) to place new players next to someone who has made moves within the last few seconds - that way there’s some activity when you join. I wasn’t able to record similar footage for One Million Chessboards; even with a thousand players online it didn’t feel like there were lots of people on the site.
Or read this on Hacker News