I have this single monolithic daemon which does multiple operations like interfacing with north bound APIs, interfacing with south bound APIs, executing state machines, building internal databases.
Currently I ended up with scalability issues and I want to redesign the daemon so that all the multiple actions inside the daemon are made concurrent. But using threads will complicate the logic since I end up having to:
- Add locks for synchronization.
- Take proper care for future extensions.
- Debug the timing issues.
So my question is please suggest a design approach where I can still make the actions concurrent and remove the complexity of threads.
My application is currently in C. Any sample open source (FOSS) project as example would also help me to understand the design approach.