comaniac commented on a change in pull request #7389:
URL: https://github.com/apache/tvm/pull/7389#discussion_r568799636



##########
File path: python/tvm/rpc/tracker.py
##########
@@ -134,7 +134,8 @@ def put(self, value):
         self._schedule()
 
     def request(self, user, priority, callback):
-        heapq.heappush(self._requests, (-priority, time.time(), callback))
+        heapq.heappush(self._requests, (-priority, self._request_cnt, 
callback))
+        self._request_cnt += 1

Review comment:
       Added a lock to make heappush atomic. I didn't make heappop atomic since 
this PR doesn't change its behavior. Let me know if there will be an issue.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to