rclabo commented on issue #763:
URL: https://github.com/apache/lucenenet/issues/763#issuecomment-1319313064

   > Async wait could free the calling thread to do other tasks instead being 
waiting/blocked. Please check reference: 
https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/async/task-asynchronous-programming-model
   
   @tonyguo2022  sure, and while that is technically true, let's not forget 
that we are talking about a background thread here.  So unless for your use 
case you expect to run out of threads or hit thread starvation, why bother?  
And to be clear, there is no code path from `IndexWriter.Commit` that writes to 
the disk, so adding a method like  `IndexWriter.CommitAsync` isn't gonna help.  
The writing to storage is not done by the thread that calls  
`IndexWriter.Commit`.  The writing to storage is done asynchronously by a 
background thread that is signaled by the fact that  `IndexWriter.Commit` was 
called on another thread earlier in time.
   
   


-- 
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: dev-unsubscr...@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to