Home > Software engineering >  Thread pool and a separate thread and cycle what to choose.
Thread pool and a separate thread and cycle what to choose.

Time:02-23

First of all, I need to detect scene is a certain number of sensors, because is real-time data accuracy is higher, the better, of course, I am currently using the open a thread then it constantly testing data of 12 sensors, because sometimes not necessarily 12 all open so to a certain extent caused the waste and efficiency is very low, if use only one, the remaining 11 to perform same will inevitably cause waste, so I'm considering whether to change to 12 sensors each sensor using a thread needs to open when don't need, he did not open, so using a thread pool is supposed to be the fastest to avoid resource waste and unnecessary switch, I can solve the above problems, a task only when execution, and it doesn't matter if you open a few thread scheduling basic need not tube, a task is executed to go, because the younger brother of thread and thread pool is not particularly well so not sure whether use the thread pool or a separate thread is good, we give some opinions final purpose is certainly increasing the efficiency and the precision of the sensor acquisition,
  • Related