This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.

4193. §[time.zone.db] the specification uses the undefined term "thread-safe"

Section: 30.11.2 [time.zone.db] Status: New Submitter: S. B. Tam Opened: 2025-01-16 Last modified: 2025-02-07

Priority: 3

View all issues with New status.

Discussion:

N5001 30.11.2.2 [time.zone.db.list] p3:

Synchronization: This operation is thread-safe with respect to reload_tzdb().

N5001 30.11.2.3 [time.zone.db.access] p2:

Synchronization: It is safe to call this function from multiple threads at one time.

N5001 30.11.2.4 [time.zone.db.remote] p3:

Synchronization: This function is thread-safe with respect to get_tzdb_list().front() and get_tzdb_list().erase_after().

The standard does not define what "thread-safe" means, which makes the meaning of these sentences unclear. Does it mean that "concurrent calls do not introduce data races", or does it additionally require a single total order on these operations? In either case, it should be specified clearly.

[2025-02-07; Reflector poll]

Set priority to 3 after reflector poll.

"We're missing a guarantee that reload_tzdb() strongly happens before a call to get_tzdb_list().front() that retrieves a newly added element. Otherwise accessing any time_zone obtained from get_tzdb_list().front() could race with the call to reload_tzdb() that writes the front of the list."

Proposed resolution: