Sunday, July 26, 2009

multi threading

There are two approaches to multi threading I have seen:
a. Avoid multi threading if possible. Multi threaded code is generally complex. In a team with multiple developers of varying capabilities, it's easy to mess up multi threaded code, or fix a bug and create two more. Or do some coding which affects performance. Single threaded model is simpler to develop and maintain. Use the KISS (Keep it Simple Stupid) principle.
b. Use multi threaded with utmost care. If we are faced with performance issues with single threaded model or forced to use multi threaded code by any factors, Be very cautious. Firstly design the multi threaded code correctly, list all improvements expected and how, develop xUnit test cases to thoroughly test your code, and then take the plunge. Be afraid, be very afraid:) and cautious!

No comments: