I have to write a c code which will contain two processes. And its executable will be launched twice on two different terminals. Both processes will know whats their role. One terminal will show result of one process and second terminal will show result of second process. If i make two threads to create these two process can some one help me out that how both processes will recognize their role when launched on terminals?
Threads != processes
You could make the program take an argument that specifies which role it has and use a socket that one of the processes/modes creates and the other connect to.