OpenVPN / ovpn-dco-win

OpenVPN Data Channel Offload driver for Windows
MIT License
47 stars 23 forks source link

Implement proper locking and memory management #89

Closed lstipakov closed 3 weeks ago

lstipakov commented 4 weeks ago

The current locking mechanism (global read-write spinlock) works fine for client (since almost all operations are read-only, such as encrypt/decrypt) but doesn't scale well for multipeer, since amount of state-modifying operations (add/remove peer, modify keys) increases a lot. Instead of a single lock:

This approach reduces contention and ensures that peer context won't be deleted during peer-specific operation.