As described above two shared resources which i.e pipes and fifos which are used to transfer data from client to server and then back to client.Requesting client: Any client which want to get particular result first write data into the server which becomes the database of server and server the read the data from the same fifo and respond according the client request. In my project i have wrote two numbers into the database of server and data is stored and send using structure in which variables of datatype is declared. Requesting client is writing into the server using REQFIFO and read result from the server from RESFIFO.Server: It receives client’s request using REQFIFO i.e read from requestfifo and further transfer this data to the adder (processing client) by writing into the requesting pipe of processing client which read data from other end of pipes. Server further read result from processing client through resulting pipe and write this result to the result fifo of requesting client.Processing Request: One invoke function is created in which fork() system call is given to handle different requests of clients and write contents of child process into the process context of parent process using execl() system call which provide facility of process replacement. This function basically carry forward the request of client to the adder(processing client) which will calculate the result of different clients. This invoke function basically use child process to send and receive different requests of user eg- Some clients wants to addition while some wants subtraction.So this is basically the load of clients which will useful when we need to handle more no. of clients.Processing clients: In my project i have used 4 different processing clients (adder, subt, divid, multi) which will calculate result of different clients according to their requests store the result into the structure. When result is prepared by processing client it write the result into the resulting pipe of processing request. Processing request (actually a server) deliver result to the requesting client. Clients finally receives data from RESFIFO.Signals: Signals are the software interrupts which we need to introduced in project to terminate particular process(client) at the right time using signal(SIGINT,handler) system call which carry SIGINT signal whose signal no. 2 and handler function as the argument. Handler function is basically user defined function in which we can set flags for signal so that particular process receive signal and read result which ensures the requesting client terminate after getting result. Signal system call basically for registering the signal into the kernel so that kernel respond not through hardware interrupt but from software interrupt which signal we have registered. Termination takes place at instant it received kill(child pid,SIGINT) system call. It is better to use kill system call before writing result into the RESFIFO of client.
It looks like you're new here. If you want to get involved, click one of these buttons!