After converting adder() into thread function, followed by reading the request from pipe, I have to release the thread semaphore created inside the auxiliary shared memory using the sem_post but I am unable to do so? What might be the possible reasons, please suggest.
Once you have converted adder() into a thread function and control passes to the thread function, initially connect to the auxiliary shared memory segment using shmat within the thread function. This step is crucial as you need to establish a connection to the auxiliary shared memory before releasing the semaphore stored inside the shared memory. After reading the request from the shared memory, use sem_post to release the thread semaphore.