3169 else { 3170 return false; 3171 } 3172 } 3173 3174 // Caveat: Solaris os::yield() causes a thread-state transition whereas 3175 // the linux and win32 implementations do not. This should be checked. 3176 3177 void os::yield() { 3178 // Yields to all threads with same or greater priority 3179 os::sleep(Thread::current(), 0, false); 3180 } 3181 3182 // Note that yield semantics are defined by the scheduling class to which 3183 // the thread currently belongs. Typically, yield will _not yield to 3184 // other equal or higher priority threads that reside on the dispatch queues 3185 // of other CPUs. 3186 3187 os::YieldResult os::NakedYield() { thr_yield(); return os::YIELD_UNKNOWN; } 3188 3189 void os::yield_all() { 3190 // Yields to all threads, including threads with lower priorities 3191 os::sleep(Thread::current(), 1, false); 3192 } 3193 3194 // Interface for setting lwp priorities. If we are using T2 libthread, 3195 // which forces the use of BoundThreads or we manually set UseBoundThreads, 3196 // all of our threads will be assigned to real lwp's. Using the thr_setprio 3197 // function is meaningless in this mode so we must adjust the real lwp's priority 3198 // The routines below implement the getting and setting of lwp priorities. 3199 // 3200 // Note: T2 is now the only supported libthread. UseBoundThreads flag is 3201 // being deprecated and all threads are now BoundThreads 3202 // 3203 // Note: There are three priority scales used on Solaris. Java priotities 3204 // which range from 1 to 10, libthread "thr_setprio" scale which range 3205 // from 0 to 127, and the current scheduling class of the process we 3206 // are running in. This is typically from -60 to +60. 3207 // The setting of the lwp priorities in done after a call to thr_setprio 3208 // so Java priorities are mapped to libthread priorities and we map from 3209 // the latter to lwp priorities. We don't keep priorities stored in 3210 // Java priorities since some of our worker threads want to set priorities 3211 // higher than all Java threads. 3212 // 3213 // For related information: | 3169 else { 3170 return false; 3171 } 3172 } 3173 3174 // Caveat: Solaris os::yield() causes a thread-state transition whereas 3175 // the linux and win32 implementations do not. This should be checked. 3176 3177 void os::yield() { 3178 // Yields to all threads with same or greater priority 3179 os::sleep(Thread::current(), 0, false); 3180 } 3181 3182 // Note that yield semantics are defined by the scheduling class to which 3183 // the thread currently belongs. Typically, yield will _not yield to 3184 // other equal or higher priority threads that reside on the dispatch queues 3185 // of other CPUs. 3186 3187 os::YieldResult os::NakedYield() { thr_yield(); return os::YIELD_UNKNOWN; } 3188 3189 // Interface for setting lwp priorities. If we are using T2 libthread, 3190 // which forces the use of BoundThreads or we manually set UseBoundThreads, 3191 // all of our threads will be assigned to real lwp's. Using the thr_setprio 3192 // function is meaningless in this mode so we must adjust the real lwp's priority 3193 // The routines below implement the getting and setting of lwp priorities. 3194 // 3195 // Note: T2 is now the only supported libthread. UseBoundThreads flag is 3196 // being deprecated and all threads are now BoundThreads 3197 // 3198 // Note: There are three priority scales used on Solaris. Java priotities 3199 // which range from 1 to 10, libthread "thr_setprio" scale which range 3200 // from 0 to 127, and the current scheduling class of the process we 3201 // are running in. This is typically from -60 to +60. 3202 // The setting of the lwp priorities in done after a call to thr_setprio 3203 // so Java priorities are mapped to libthread priorities and we map from 3204 // the latter to lwp priorities. We don't keep priorities stored in 3205 // Java priorities since some of our worker threads want to set priorities 3206 // higher than all Java threads. 3207 // 3208 // For related information: |