NightOwl888 commented on issue #935:
URL: https://github.com/apache/lucenenet/issues/935#issuecomment-2127030754

   I have just submitted #940 with a patch. Well, there were 3 different 
attempts.
   
   While identifying the problem wasn't too difficult, finding a solution for 
Issue 2 turned out to be quite challenging due to how performance sensitive of 
an area this is.
   
   If interested parties could run some benchmarks and/or review the PR to 
provide some feedback on how to improve this approach, suggestions would be 
welcomed. I have already attempted `Thread.Sleep(1)`, `Thread.SpinWait(1)` and 
the `SpinWait` struct as part of the retry loop, but all of these seem to slow 
the tests down a lot. I don't think it would work right if `Thread.Yield()`  
were not also used, but it seems to perform best with only `Thread.Yield()` and 
nothing else.
   
   I also gave `SpinLock` a try. Although it has all of the API members we 
need, it is not a reentrant implementation, so no dice.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to