003 Linux System ProgrammingIssues, queries and suggestions related to Linux, Linux Programming, IPC, Interprocess Communication, Synchronization, Semaphore, System Programming, Linux Software Development.
Multi-Threaded Client Server Module using Inter-process-communication ( IPC ) Techniques
Aim:-
To Test System capability and resources by running multiple threads, establishing client server module within system and to get hands on IPC techniques i.e. PIPE, FIFO, Shared Memory, Message queue, etc
and synchronisation techniques i.e Mutex and Semaphore.
a) Initially Server runs and creates all the four IPC techniques i.e. PIPE, FIFO, Shared Memory, Message Queue
b) Then server creates, Process Request Thread and stays in block-on-read to receive data from FIFO from client side
c) In meantime client runs, Opens FIFO and write data into it and then client waits in the message queue for its response from server side
d) As soon as client writes data, Process Request Thread in server comes out of block-on-read and does fork() call.... The parent process writes data in pipe and waits for the vendor response
e) On the other hand, child process does exec() call and child process is replaced by the invoked vendor process
f) Vendor execution begins --> reads data from pipe then perform operations on data and write the result in shared memory --> finally vendor ends
g) Process Request thread will resume execution and reads result from shared memory.
h) Then result will be return into message queue by PR thread.
i) Now result in message queue will be read by respective client. Hence one cycle of execution completes.