forked from ray-project/ray
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[core] GcsClient: No GIL for C++ pb serialization (ray-project#46926)
Currently we hold the GIL when we do conversion `C++ pb message` -> `serialized string` -> `Python pb message`. However only the latter is needed; the first conversion is a pure C++ call and we should not hold the GIL. Adds a `c_vector[c_string]` to hold the strings and do the serialization in a `nogil` block. Then with gil, we convert it to Python objects. Not doing per-object locking because GIL is expensive to hold. Also makes the conversion functions and the future assignment function `with gil`, so the C++ wrapper code `PyCallback` needs not to do it, except for error checking. Signed-off-by: Ruiyang Wang <[email protected]>
- Loading branch information
Showing
3 changed files
with
55 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters