View Issue Details

IDProjectCategoryView StatusLast Update
0001825Issue 8 draftsSystem Interfacespublic2024-05-20 15:26
Reporterdannyniu Assigned To 
PrioritynormalSeverityCommentTypeClarification Requested
Status ClosedResolutionWithdrawn 
Product VersionDraft 4.1 
NameDannyNiu/NJF
Organization<individual>
User Reference
Sectionpthread_rwlock_*
Page Number1787-1804
Line Number59262-59785
Final Accepted Text
Summary0001825: Does releasing a reader lock carries a "release" memory order semantic?
DescriptionThis arise from my activity elsewhere. For background: https://softwareengineering.stackexchange.com/q/451085/290091

Initially I thought: releasing a reader lock does not issue a release memory order semantic, since the thread holding the reader lock doesn't make modification to the content protected by the reader lock.

However later I thought: releasing a reader lock is supposed to carry a release memory order semantic, since the thread may modify other areas of application memory, or issue system calls that modifies system memory.
Desired ActionI'd like to confirm my thinking - whether my second thinking is correct. I hope my second thinking is correct and be added to the text of the standard, preferably into normative parts.
TagsNo tags attached.

Activities

geoffclare

2024-04-02 15:28

manager   bugnote:0006733

Doesn't XBD 4.15.2 Memory Synchronization already provide what is requested here?

dannyniu

2024-04-03 04:11

reporter   bugnote:0006735

Ah, my idiocracy.

But I still find a bit of problem here. Line 3043-3045:

> This standard defines a number of atomic operations (see <stdatomic.h>)
> and operations on mutexes (see <threads.h>) that are specially
> identified as synchronization operations. These operations play a
> special role in making assignments in one thread visible to another.

We also have the <pthread.h> header, as well as several other synchronization primitives. Maybe these should be added?

geoffclare

2024-04-04 09:09

manager   bugnote:0006736

Those lines are from 4.15.1 which is derived from C17 and applies to the functions from C17. It's 4.15.2 that covers (carries forward from Issue 7) the memory synchronization requirements for the older POSIX synchronization primitives.

dannyniu

2024-04-04 14:34

reporter   bugnote:0006738

All right then. I'm not objecting to anything here as I've ticked the comment option when I opened this bug.

Thanks for the clarification Geoff!

Issue History

Date Modified Username Field Change
2024-04-02 06:44 dannyniu New Issue
2024-04-02 06:44 dannyniu Name => DannyNiu/NJF
2024-04-02 06:44 dannyniu Organization => <individual>
2024-04-02 06:44 dannyniu Section => pthread_rwlock_*
2024-04-02 06:44 dannyniu Page Number => 1787-1804
2024-04-02 06:44 dannyniu Line Number => 59262-59785
2024-04-02 15:28 geoffclare Note Added: 0006733
2024-04-03 04:11 dannyniu Note Added: 0006735
2024-04-04 09:09 geoffclare Note Added: 0006736
2024-04-04 14:34 dannyniu Note Added: 0006738
2024-05-20 15:26 nick Status New => Closed
2024-05-20 15:26 nick Resolution Open => Withdrawn