Re: On Programming Needs [pretty off-topic, i guess]
- Posted by katsmeow Mar 17, 2023
- 1618 views
One place this came in really handy was in serving http pages. Each connection got their own http.sock.* set of variables, one of which was the socket number. It made threading so easy: every run thru those procedures knew only the data named with the socket number at that time. Anything to do with that socket number could be monitored by scanning the variable list with the same or a second program. At the end of the transaction, when the socket was closed, all http.sock.[number].* were deleted. Timer names could be built the same way, but were not in the var list, they were in a separate less-global timer list. So a timer of http.socketnumber could be terminated, or if time passed without resetting it, and it fired, there may be a hung connection. It was over 20 years ago i wrote such things. I deleted so much code like that, megabytes of it. People seemed to be happier when it no longer existed.
Kat