First page Back Continue Last page Overview Graphics
Locking Strategy
Lock data structures
- Don't use finer locks than required by UNIX API
- I.e., parallel send and receive on the same socket is useful, but not parallel send on the same socket
- Lock references to in-flight packets, not packets
- Layers have their own locks as objects at different layers have different requirements
Lock orders
- Driver locks are leaf locks with respect to stack
- Protocol drives most inter-layer activity
- Acquire protocol locks before driver locks
- Acquire protocol locks before socket locks
- Avoid lock order issues via deferred dispatch