-
Notifications
You must be signed in to change notification settings - Fork 0
Thread Safety
v2rayroot edited this page Jun 14, 2026
·
1 revision
Start, Stop, and GetStatus synchronize global runtime state. Applications
should still serialize lifecycle commands to avoid confusing user-visible
transitions.
Only one engine is supported per process. Use separate processes for isolation.
Realtime speed callers share one baseline. Designate one polling task.
Parser calls can update the process-wide XRAY_LOCATION_ASSET environment
variable. Serialize calls that use different asset directories.
TestLatency runs entries concurrently. Limit batch size to control CPU,
memory, sockets, and file descriptors.
Never unload the shared library while:
- Xray is running
- Native calls are active
- Returned native strings are still owned by the application