Skip to content
Tcl Source Code Check-in [ec22729420]
Login

Check-in [ec22729420]

Overview
Comment:Clarified that it is suboptimal to hold the associated mutex when signaling a condition variable. If the mutex is held, there is a danger of the signaled, hence newly awakened threads of immediately blocking again when trying to acquire the mutex. This is avoided by signaling after releasing the mutex. Naturally, this somewhat increases the danger that an unrelated thread will enter the mutex and invalidate the underlying condition. However, this case cannot be ruled out even when the condition variable is signaled while the mutex is being held. The "spurious wakeup" clause forces applications to re-check the condition after reacquiring the mutex in any case.
Timelines: family | ancestors | descendants | both | windows-thread-join
Files: files | file ages | folders
SHA3-256: ec2272942084b82b2085c37161d3287dc52c0501e59844cd0a01ce69d0a76de6
User & Date: konrad.schwarz on 2023-04-02 15:41:39.624
Original User & Date: mchn1350 on 2023-04-02 15:41:39.624
Other Links: branch diff | manifest | tags
Context
2023-04-03
07:41
Windows Threads are joinable check-in: af4d891ecb user: mchn1350 tags: windows-thread-join
2023-04-02
15:41
Clarified that it is suboptimal to hold the associated mutex when signaling a condition variable. I... check-in: ec22729420 user: konrad.schwarz tags: windows-thread-join
08:45
Replaced non-thread-safe re-initialization checks with the Win32 INIT_ONCE one-time initialization A... check-in: 8360452e48 user: konrad.schwarz tags: windows-thread-join
Changes