Program language: C++ 11
I use pipeline threads mode to deal data.
One thread generate data.
One thread process data.
While no data to deal, which is the best way to yield thread?
Now I use
std::this_thread::sleep_for(100ms);
- I wonder if there is a better way to yield?
- If sleep is well enough, how long time to sleep is better?
Aucun commentaire:
Enregistrer un commentaire