I have a number of long calculations that I need to perform regularly in a realtime game. Currently, I try to avoid stuttering by timeslicing them. But, it can be tedious to split up the code in blocks that can perform below the time limit and it also introduces complexity in the algorithms.
Are there any better approaches? I have thought about creating worker threads instead but it seems like I would just have to deal with a whole new set of problems.