Using threads causes:
- Application speed problems due to inherent delays in inter-thread communications and the inherent wait/sleeps that will creep in.
- Require thread safe objects.
- Leads to complex design which will lower code health.
- Not deterministic.
When the design is changed to remove the threads the design becomes simpler (and hence the code healthier). Of course the change is done to eliminate intermittent defects (product health) which do disappear when the threads are removed.
Threads are added to code either because:
- The future impact on the code health (the cost of that design) is not understood.
- The alternative design approach is not known.
- There is a fear of processing time to do what is required. You have no choice anyway as you must do what is required as "it is required" :-). If you use a thread it will just take longer anyway.
If you have threads in your application, get rid of them. You are probably already having to update code to make it thread safe. If so, you just adding complexity as a design defect deodorant. The increased complexity will lead to more defects ... sound familiar?
No comments:
Post a Comment