summaryrefslogtreecommitdiff
path: root/api/api_test.go
diff options
context:
space:
mode:
author Yohei Yukawa <yukawa@google.com> 2024-07-25 12:59:07 -0700
committer Yohei Yukawa <yukawa@google.com> 2024-07-25 12:59:07 -0700
commitd1e9ca2c6581774a01e8c3e7510f8c1962a155ee (patch)
treeb07591fe82bcb7aa7830be525aa3acc67b90c239 /api/api_test.go
parente47b907e7887767480d28b84b83b2916db7b1d01 (diff)
Make *Repository#get(int userId) lock-free
This reworks how IME-related per-user data can be queried in a thread-safe manner. Basically the idea is to make query operations lock-free by making sure that the underlying SparseArray is immutable. While we still need a lock for data mutation, simple read access no longer requires any lock at the cost of putting the sparse array into a volatile field, which has gotten pretty cheap on both ARM and remain so on X86 at least compared to synchronized blocks. There must be no observable behavior change beyond the performance characteristics. Bug: 353307830 Fix: 352594784 Test: atest FrameworksInputMethodSystemServerTests:ImmutableSparseArrayTest Flag: EXEMPT refactor Change-Id: Id0783e57c7e8ff70f16f3c3d486f5a5e64bbe7db
Diffstat (limited to 'api/api_test.go')
0 files changed, 0 insertions, 0 deletions