How to do safe multi-threading?
Posted on 2006-05-11
Hi. My app was designed as an old-fashioned batch program. (I ported it from COBOL...) It has a handful of programs that just crunch through a big data file and spit out reports.
I'm now being asked to make them run faster by using multi-threading. Most likely, that would mean making those programs run concurrently, rather than consecutively as they do now. My problem is, I've done absolutely nothing yet in terms of thread safety (multi-threading had been explicitly rejected in the original design), and I've now got about one hundred classes and probably 100,000 lines of code...
Could anyone suggest how I'd start? What would be the top 5 things to do? I know I'd need to declare a lot of methods synchronized, but what else?