mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-01-07 12:04:30 +01:00
Merge #5122
5122: Yield the BBQueue writing loop r=ManyTheFish a=Kerollmops We prefer yielding to let the writing thread do its job instead of spin looping. Co-authored-by: Kerollmops <clement@meilisearch.com>
This commit is contained in:
commit
3ded069042
@ -661,6 +661,11 @@ where
|
|||||||
if sender.is_disconnected() {
|
if sender.is_disconnected() {
|
||||||
return Err(Error::InternalError(InternalError::AbortedIndexation));
|
return Err(Error::InternalError(InternalError::AbortedIndexation));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We prefer to yield and allow the writing thread
|
||||||
|
// to do its job, especially beneficial when there
|
||||||
|
// is only one CPU core available.
|
||||||
|
std::thread::yield_now();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user