I never realized how important buffers were until today. I mean, you really don’t see them much when programming in languages like C# where most of that stuff happens behind the scenes. Basically, what was happening was that I was working on a Chat application in Silverlight, when one of my co-workers came up with a scenario of multiple private messages coming through before the private message window has fully opened.
Hmm… I thought to myself, that’s a tough one. I’ve never come across that problem before. And sure enough when I tested it, it broke my application all sorts of ways. But then something another co-worker said to me that got me thinking was that it was sort of like writing to a disk. You don’t just write all your information straight to the disk. The disk is waaaaay slower than the computer’s RAM at reading and writing, so there has to be something to hold that information. Now when you’re writing in C# you almost never see this because it’s handled for you, but adding some sort of cache to hold the information and checking to see if the receiver is ready for it made the application work correctly and as expected.
Way to go for buffers!
You must be logged in to post a comment.