Created by: abhinavarora
Fixes https://github.com/PaddlePaddle/Paddle/issues/8815 Fixes https://github.com/PaddlePaddle/Paddle/issues/8864 Fixes https://github.com/PaddlePaddle/Paddle/issues/8863 Fixes https://github.com/PaddlePaddle/Paddle/issues/9083
This PR does the following:
- Implement a non-blocking CanSend and CanReceive for Channels
- Exposes methods to the channel to externally add tasks on SendQueue and RecvQueue. These will be called by the Select op
- Add IsClosed method, that will be used by select op
- Allows QueueMessage to support callbacks. This callback will be provided by the select op. The callback will be used by the select op to keep a track of the case that is executed.
- Provides the ability to share condition variable in the QueueMessage for different channels.