Sunday, February 23, 2014

c# async model

I dislike the async/await way of doing things, thinking that it made the developer's life harder, hiding the threading for no reason (not to mention the messed up stock). Recently one of our companies project was done with that, and I was able to make the project faster by remove some of the async stuff (there is an operation that writes on a single pipe, so I made it single threaded and used a queue instead of the async way of doing things). However during a recent discussion, one of my college's comment kind of wake me up a bit. He said the reason async/await is better is that internally it actually queue things up. Now that made sense. I think MS should make it even better, that is on any IO operation on a task, it should immediately queue it and make the thread available for next queued task, this way we can actually do away with the async/await mess and the complexity will be handled internally without any developer mangling.