Previous | Next --- Slide 18 of 60
Back to Lecture Thumbnails
cgjdemo

I am a little confused about the SENDPROBE(h1) and RECVPROBE(h2) here. Are these two functions blocking or non-blocking? If they are blocking, we still cannot do anything until we verify the the message has been sent or received. But if they are non-blocking which means they will return immediately when they are called (maybe before the message was acknowledged), in this case how can we ensure that the send or receive is successful?

sam

I think SENDPROBE(h1) and RECVPROBE(h2) are just checking if particular send or receive happened. If the action is taken then it is ok to use the buffer. These functions should be non-blocking functions and should return immediately. I think function of PROBE is to check if use of buffer is ok or not and not to check if message is send or received successfully.

kayvonf

@sam: correct. The functions return immediately with a result that indicates whether the message referred to be the provided handle has been successfully sent/received. If this is the case, the buffer storing the message is once again free for manipulation by the calling thread.

jazzbass

I think that it would be useful to have a slightly different API for these non-blocking asynchronous functions, perhaps adding a function pointer argument to the SEND and RECV functions that is called whenever the SEND/RECV function completes.

For instance SEND(void * buf, void(*on_send_complete)(int handle)). This way we could avoid looping indefinitely checking for the status of SENDPROBE to see if we can proceed or not.