The embodiment of the invention provides a thread
processing method and device, relates to the technical field of computers, and can solve the problem of
priority inversion in a conditional variable scene and improve the execution efficiency of threads. The method is applied to the
electronic equipment, the
electronic equipment comprises a target processor, the target processor comprises a target running
queue, the target running
queue comprises a first thread, a second thread and a third thread, and the method comprises the steps that under the condition that the condition of a target condition variable is not met, the first thread enters a
sleep state, and the third thread enters a
sleep state; the data is not cleared from the target operation
queue; the condition of setting the target condition variable by the second thread is met, and the first thread is awakened; under the condition that the condition of the target condition variable is met, the first thread continues to run; after the first thread runs, the third thread runs, and the priority of the third thread is higher than that of the second thread and lower than that of the first thread.