3 ms·
Small nitpick: it doesn't, and never had to be, HTML that was emitted. Executables were/are responsible for headers (including `Content-type`) as well as the bo
by darrenf 6y ago
Small nitpick: it doesn't, and never had to be, HTML that was emitted. Executables were/are responsible for headers (including `Content-type`) as well as the body.
- shagie 6y agoAn example of this was the old, classic, counter.cgi which, when accessed would: * Read a file containing an integer * Increment the integer in memory * Emit a .gif with the new value * Write the new value back to the file
- anyfoo 6y agoThat's a bad order to do things, is that how it worked? There is a huge window while emitting the .gif during which other visitors may appear. At best a new visitor appearing during another visitor's "emit gif" phase does not increment the counter, at worst a visitor on a very slow line causes the cgi instance for this visitor to run for a long time and then write back a very old value to the file, making the counter run backwards. For things that matter, the counter reading+increasing should be an atomic read-modify-write. But since this is just a web counter, I guess it's sufficient if you at least keep the hazardous window very small (by not doing the write-back at the end).
- spookthesunset 6y agoI mean, these were slapped onto peoples personal pages right below an animated "under construction" gif and fractal looking background images. Accuracy was not a huge concern.
- guidoism 6y agoHeh yeah. It didn’t matter because there weren’t that many people hitting the pages. It was more of a thing to do that was cool because when it hit like a thousand you would be like “OMG a THOUSAND people all over the world have visited my page, what a world we live in”
- c0achmcguirk 6y agoAnd dynamic--anything dynamic--was completely insanely cool.
- yjftsjthsd-h 6y agoFor this case, eventually consistent is good enough
- dredmorbius 6y agoIf you're not locking the counter whilst reading, incrementing, applying, and updating it, what you're eventually getting ... isn't really consistency. "A widely shared myth" would be more accurate.
- anyfoo 6y agoYeah, the "it's just a web counter, so maybe just keep the window small" suggestion I made in the end was not meant to say that this provides any consistency, just that it keeps the underestimation of actual visitors smaller. By the way, I'm totally aware that those counters didn't matter, but I thought it's worth discussing anyway. Someone might read this and apply it to things that matter.