A low priority thread (at priority P3) acquires the lock on an object and is pre-empted by a higher priority thread (at priority P1), as the specification mandates.
就像规范要求的那样,一个低优先级线程(优先级p3)获取了一个对象的锁,会被一个高优先级(优先级p1)的线程夺取执行权。
An application that must respond to events in a well-defined time has no way to ensure that another low-priority thread won't get scheduled in front of a high-priority thread.
一个必须在精确时间内响应事件的应用程序无法确保不会在一个高优先级线程之前调度另一个低优先级线程。
It's possible that, at the point the high-priority thread tries to acquire the low-priority thread's lock, the low-priority thread itself is blocked on a different lock held by a another thread.
可能存在下面一种情况:高优先级线程试图获取低优先级线程持有的锁,而低优先级线程自身又被另一个线程持有的另一个锁阻塞。
Another possibility is to fork a separate low-priority thread during startup to perform initialization when the system is idle, although this choice requires more care to handle synchronization.
还有一种可能是在启动时派生一个单独的低优先级的线程,当系统空闲时再去完成初始化,不过这种方法需要特别注意处理好同步。
Priority inversion is a condition where a high-priority thread is blocked on a lock held by a low-priority thread.
优先级反转指的是阻塞高优先级线程的锁由低优先级线程持有。
For example, a high-priority thread manages time-critical tasks, and a low-priority thread performs other tasks.
例如,高优先权执行绪处理时间紧急的工作,而低优先权执行绪执行其他工作。
In the scenario just described, the low-priority thread runs at high priority when lock contention occurs until the point in time that it releases the lock.
在刚刚描述的场景中,发生锁争用时低优先级的线程以高优先级运行,直至线程释放锁。
In this case, the low-priority thread and that other thread are boosted.
在这种情况下,低优先级线程和另一个线程都会被提高优先级。
In this case, the low-priority thread and that other thread are boosted.
在这种情况下,低优先级线程和另一个线程都会被提高优先级。
应用推荐