[crac] RFR: Wake up all TIMED_WAITING threads after restore [v4]

Anton Kozlov akozlov at openjdk.org
Fri Jun 30 14:22:22 UTC 2023


On Fri, 30 Jun 2023 08:08:16 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 with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
> 
>  - Merge remote-tracking branch 'origin/crac' into timed_wait
>  - Don't use OS thread state
>  - Inline Thread::interrupt
>  - Use Threads::java_threads_do, check spurious timeouts
>  - Wake up all TIMED_WAITING threads after restore
>    
>    Threads that enter sleep or timed parking use absolute monotonic time
>    for pthread_cond_wait(). The specification permits spurious wakeups;
>    implementation either handles that transparently or propagates
>    the wakeup.
>    
>    This commit does not handle timed waiting in non-Java threads other than
>    WatcherThread.

LGTM, thank you!

-------------

Marked as reviewed by akozlov (Lead).

PR Review: https://git.openjdk.org/crac/pull/85#pullrequestreview-1507288596


More information about the crac-dev mailing list