Quote:
Originally Posted by chrism01
Need more info: how are the processes created, what lang eg C using fork ?
|
Here, according to this code it create 4 concurrent children.
#include <signal.h>
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
main(){
int pid;
int i;
for (i = 1; i <= 4; i++){
if(pid != 0)
pid = fork();
}
sleep(10);
}
From those 4 processes i need to use one process as "RECEPTIONIST" & other three as "AGENTS".
To do so, how can i differentiate the processes.
RECEPTIONIST should read from a file and should send those to message queue.
AGENTS should read from that message queue.
(I need to have 1 RECEPTIONIST FUNCTION & 1 AGENT FUNTION.So to which process i should write those functions)
How can i do that...