Reputation: 815
I've been looking into threading and the complications it could bring to your application. There are many instances in my application where the functions are a huge number of lines of code(500-1k+ lines), and when applicable, would like to quicken these function calls.
Is threading mostly designed for let's say, database queries while running UI code, etc or would it work in my situation and cutting up my method into some threads so we can concurrently run through the function theoretically cutting the process time down a little?
Just looking to see if this situation would be worth looking into and spending time researching
Upvotes: 0
Views: 66
Reputation: 3615
You spawn a new thread when you don't want to tie up the main (application) thread. For example, if you are loading some images that take a while to load, you could do that in a separate thread so that the UI is still responsive.
This is probably a case where you should just refactor your existing code. Threading your existing code might help to speed things up a little bit, or it might cause more problems than it solves. Either way, it isn't going to make your existing code (which sounds like it needs to be cleaned up) any better.
Upvotes: 1