[crac] RFR: Wake up all TIMED_WAITING threads after restore [v3]
Anton Kozlov
akozlov at openjdk.org
Fri Jun 23 12:23:02 UTC 2023
On Wed, 21 Jun 2023 12:45:14 GMT, Radim Vansa <rvansa at openjdk.org> wrote:
>> This is a fix for an issue found by @jankratochvil when testing #53: Threads that enter sleep or timed parking use absolute monotonic time for pthread_cond_timedwait(). When the monotonic time changes during C/R we need to wake all threads to readjust the timeout to the new absolute time.
>>
>> This introduces effectively a spurious wakeup; this is permitted for all the uses of pthread_cond_timedwait. Implementation either handles that transparently or propagates the wakeup to Java.
>>
>> This commit does not handle timed waiting in non-Java threads other than WatcherThread.
>
> Radim Vansa has updated the pull request incrementally with one additional commit since the last revision:
>
> Inline Thread::interrupt
src/hotspot/os/linux/os_linux.cpp line 6128:
> 6126:
> 6127: assert(thread->is_Java_thread(), "must be called from java_threads_do");
> 6128: JavaThread *jt = (JavaThread *) thread;
A nit, just to mention:
Suggestion:
JavaThread* jt = thread->as_Java_thread();
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/85#discussion_r1239749024
More information about the crac-dev
mailing list