I'm writing some program which should perform calculations concurrently according to inputs which reach the system all the time. I'm considering 2 approaches to allocate "calculation" processes:
1. Allocating processes in the system initialization, insert the ids to Processes table, and each time I want to perform calculation, I will check in the table which process is free.
The questions: can I be sure that those processes are only for my use and that the operating system doesn't use them?
2. Not allocating processes in advance. Each time when calculation should be done ask the operating system for free process.
I need to know the following inputs from a "calculation" process:
1. When calculation is finished and also if it succeeded or failed
2. If a processes has failed I need to assign the calculation to another process
I hope my post is not too long.
Thanks in advance. Any help would be appreciated.