[Openib-windows] RE: duplicate socket deadlock in WSD
Fab Tillier
ftillier at silverstorm.com
Sun Oct 30 09:01:41 PST 2005
> From: Yossi Leybovich [mailto:sleybo at mellanox.co.il]
> Sent: Sunday, October 30, 2005 12:39 AM
>
> I did not tried the patch yet but from reading it I can see that you use
> wait_cq_drain Without locking the sock_info->mutex
> Isn't it problem to check the counters without locking the sock_info first ?
The counters are atomic and declared as volatile. The check is for zero only.
There is no need to use a mutex or critical section in this case: the counter
will only go down in value when that call is made due to the state the socket is
in. If a stale value is read, it will be non-zero and eventually zero will be
read on a subsequent iteration through the loop.
Thanks for the review!
- Fab
More information about the ofw
mailing list