masahi commented on a change in pull request #10234:
URL: https://github.com/apache/tvm/pull/10234#discussion_r812550486
##########
File path: src/runtime/pipeline/pipeline_struct.h
##########
@@ -42,6 +52,75 @@ using GlobalOutputPair = std::pair<int, int>;
* The first 'int' is the module index, and the second 'int' is the module
output index.
*/
using ModuleOutputPair = std::pair<int, int>;
+/*!
+ *\brief The pair includes the module index and the module input index.
+ * The first 'int' is the module index, and the second 'int' is the module
input index.
+ */
+using ModuleInputPair = std::pair<int, int>;
+/*!\brief The data notification structure.*/
+class DataNotify {
+ private:
+ /*!\brief The 'contitional variable' is used to wait for notification.*/
+ std::condition_variable condition_;
+ /*!\brief The mutex is used to protect the 'conditional variable'.*/
+ std::mutex mutex_;
+ /*!\brief Whether a data is ready or not.*/
+ volatile bool data_ready_ = false;
+ /*!\brief Whether the thread should exit or not.*/
+ volatile bool exit_state_ = false;
Review comment:
I don't know, but all of SO answers I looked at say volatile is not
needed for threading purpose. For example
https://stackoverflow.com/questions/4557979/when-to-use-volatile-with-multi-threading
Any thought?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]