i am new so i might be overlooking something.
i tried to use the MsgSend & MsgReceive without luck.
in my main function i have :
void main (void)
pthread_create(&ptTaskprocesserThread, NULL, &TaskprocesserThreadFunc,
in my sending thread i have this :
I notice that MsgReive blocks ,but MsgSend returns -1
Whats wrong in my code ?
this is my client thread code to receive a message
void* TaskprocesserThreadFunc(void *vArguments)
// Infinite loop
// Receive the message
iReceiveIdentifier = MsgReceive(chid,
// Check if this is a message
if(iReceiveIdentifier != -1)
printf(“Message received with value %d \n”, receivedvar);
replyvar=2 * receivedvar;
// Send the reply
if(MsgReply(iReceiveIdentifier, 1, &replyvar, sizeof(replyvar))
printf("[Client] Error sending reply: %s \n", strerror(errno));
// Display the destruction message
printf(“Destroying task thread\n”);