[libc-commits] [PATCH] D148288: [libc] Update RPC interface for system utilities on th GPU

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Apr 14 07:30:25 PDT 2023


jhuber6 added inline comments.


================
Comment at: libc/src/__support/RPC/rpc.h:56
+///   - For every 'send' / 'recv' call on one side of the process there is a
+///     mirrored 'recv' / 'send' call.
+///
----------------
goldstein.w.n wrote:
> IIUC this means it must be send/recv/senc/recv back-and-forth pattern? This seems contradictory to "mostly arbitrary combinations of 'send' and 'recv'" no? 
Yes, poor choice of words. I meant arbitrary combinations on one side as long as it's mirrored on the other side. So, the following will work:
```
Client:  send -> send -> send -> recv -> send -> recv -> recv -> send -> recv
Server: recv -> recv -> recv -> send -> recv -> send -> send -> recv -> send
```


================
Comment at: libc/src/__support/RPC/rpc.h:237
+  uint32_t open = 0;
+  if (!lock->compare_exchange_strong(open, 1))
+    return cpp::nullopt;
----------------
goldstein.w.n wrote:
> given that is only two states, exchange is enough, no need for CAS.
> 
> Likewise below.
Good point, it's mostly a placeholder right now as we only support single threaded access. (At least this means if you call it with multiple threads it will wait until the other one is done).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148288



More information about the libc-commits mailing list