[libc-commits] [PATCH] D153573: [libc] Move fences into outbox/wait-for-ownership test

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Jun 22 10:02:09 PDT 2023


jhuber6 added inline comments.


================
Comment at: libc/src/__support/RPC/rpc.h:145
 
+  // Given current outbox and inbox values, wait until the inbox changes
+  // to indicate that this thread owns the buffer element.
----------------



================
Comment at: libc/src/__support/RPC/rpc.h:147
+  // to indicate that this thread owns the buffer element.
+  LIBC_INLINE uint32_t wait_for_ownership(uint64_t index, uint32_t outbox,
+                                          uint32_t in) {
----------------
Why does this return a value?


================
Comment at: libc/src/__support/RPC/rpc.h:361
 
-  // We need to wait until we own the buffer before sending.
-  while (Process<T, S>::buffer_unavailable(in, out)) {
-    sleep_briefly();
-    in = process.load_inbox(index);
-  }
+  // We need to wait until we own the buffer before receiving.
+  Process<T, S>::wait_for_ownership(index, in, out);
----------------



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153573/new/

https://reviews.llvm.org/D153573



More information about the libc-commits mailing list