Hi I am not the original poster but am experiencing exactly the same issue. very frustrating.

I understand what you say and it would appear this seems to be a threading issue as my program uses multiple threads (1 per connection).
As far as I am aware all critical pieces of code are protected with re-entrant mutexes but perhaps I have missed something.

I am new to Linux programming and need to resolve this issue....