You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given the architecture of Thine, where the policy logic is implemented in Rust and the key/value map resides in Python, enabling free-threaded support for the Python part should be feasible while keeping the Rust portion single-threaded. Rust is significantly faster than Python, and single-threaded match the design of BP-Wrapper. The change will make the policy read somewhat lossy, but this is intentional and already used in theine-go.
add locks(in Python)
use sharded map
replace keygen with hash()
The hash value is used in the policy as the identity of an object. So rust policy code doesn't need any PyObject. This approach separates the policy component from the main Python code as much as possible, keeping the policy single thread and avoiding the complexities of CPython/PyO3/nogil stuff, also simplifying the code(slower than put everything in Rust, but when Python has better JIT this might be improved). The trade-off is the potential for hash collisions, where multiple objects with the same hash will share the same entry in the policy. However, given Python's significant memory overhead and the often limited cache size, collisions should not be a major issue.
Given the architecture of Thine, where the policy logic is implemented in Rust and the key/value map resides in Python, enabling free-threaded support for the Python part should be feasible while keeping the Rust portion single-threaded. Rust is significantly faster than Python, and single-threaded match the design of BP-Wrapper. The change will make the policy read somewhat lossy, but this is intentional and already used in theine-go.
hash()
tlfu
policy, the best oneThe text was updated successfully, but these errors were encountered: