Created attachment 256351
this fix solves the issue without any overhead of extra per thread locking and a simple lightweight retry
This has been extensively tested on a multi-proc Xeon server with the reproducers and fixes the issue. I've checked this out with a high contention of pthreads and the retry loop occurs very rarely, so the overhead of the retry is very small indeed.
Created attachment 256351
this fix solves the issue without any overhead of extra per thread locking and a simple lightweight retry
This has been extensively tested on a multi-proc Xeon server with the reproducers and fixes the issue. I've checked this out with a high contention of pthreads and the retry loop occurs very rarely, so the overhead of the retry is very small indeed.