Anonymous user
Message Passing Tutorial: Difference between revisions
→Receiving
[unchecked revision] | [unchecked revision] |
Line 76:
message tmp=NULL;
disable_task_switch();
if (buff.count!=0)
tmp=pop(buff);
while(topwaitqueue()!=NULL) awake(popwaitqueue());
}
enable_task_switch();
return (tmp);
}
</source>
Note that we count on recv being blocking to implement synchronous transfer. If you use the non-blocking code above, you'll have to take care of that
== Synchronous ==
|