In fact it's worse than this.  You send a message only to processes if remote_sends.has_key, but you post a receive to all processes (so some may be unmatched).  If I read the above code correctly, I think you should (to receive) only receive from self._receives.keys(), right?