I got few problems in Process creation and IPC in Solaris using C++.
This is my problem in a nutshell.
--I do have main process ---> A (say)
---And I want to create child processes of A which are doing independent tasks.
(say C1, C2, C3, ....etc)
Interface of A
------SendMessage(int childID, string str);
---There sholud be a method to create processes (say) CreateChild(int childID)
---After createing a child process we sholud be able to send messages to channel processes using SendMessage(int childProcessID); messge should go to that particular id that is given. After sending message we have to get reply to that one as well.(Here there can be replies from many processes ; they are identified by child Process No.
-----The problem that I have is if I use fork() with in the main processes the all the methods that are specified in main processes (A) is duplicated in to all the child processes. And each time I called a method in A...That will called with in the child processes as well. So how organized the system inorder to avoid this..