My day today at office was great. Not just because it was productive. But for a change I felt like I achieved something.
I dont have a lot of experience in multi-threaded programming. And recently I was given this task of converting a single threaded application to multi threaded. I wrote so many versions of this one task until I reached the final pseudocode.
1. A simple thread application that uses polling to communicate with the child.
2. Ofcourse, polling is not CPU efficient, used semaphores.
3. Then, I came across this new .NET term 'ThreadPool'. More efficient, so modified the existing forking scheme to use thread pools instead.
4. One thread pool was not prioritizing threads properly. Priority thread pool didnt suit the requirement. Split to use two Thread pools.
5. Further on, more enhancements ... Exception handling, logging, etc etc.
I started off the day knowing nothing about threads. By the end of the day, I knew more than 5 ways to implement the same requirement.
Feels good. Thats what I call a good day at office.