Skip to content

gh-111965: Use critical sections to make io.TextIOWrapper thread safe - #112193

Merged
corona10 merged 7 commits into
python:mainfrom
aisk:critical-sections-textiowrapper
Nov 18, 2023
Merged

gh-111965: Use critical sections to make io.TextIOWrapper thread safe#112193
corona10 merged 7 commits into
python:mainfrom
aisk:critical-sections-textiowrapper

Conversation

@aisk

@aiskaisk commented Nov 17, 2023

Copy link
Copy Markdown
Member

@aiskaisk changed the title ssing critical sections to make io.TextIOWrapper thread safegh-111965: using critical sections to make io.TextIOWrapper thread safeNov 17, 2023
@@ -0,0 +1 @@
Using critical section to make ``io.TextIOWrapper`` thread safe without GIL.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I commented before, NEWS.d is not needed for this task

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, just noticed it

@colesbury
colesbury self-requested a review November 17, 2023 14:34
@colesburycolesbury changed the title gh-111965: using critical sections to make io.TextIOWrapper thread safegh-111965: Use critical sections to make io.TextIOWrapper thread safeNov 17, 2023

@colesburycolesbury left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@corona10 would you please look over this one as well?

Comment threadModules/_io/textio.c Outdated
#include "Python.h"
#include "pycore_call.h" // _PyObject_CallMethod()
#include "pycore_codecs.h" // _PyCodecInfo_GetIncrementalDecoder()
#include "pycore_critical_section.h"

@corona10corona10Nov 18, 2023

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment as the same as the other header. // Py_BEGIN_CRITICAL_SECTION()

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Comment threadModules/_io/textio.c Outdated
aiskand others added 2 commits November 18, 2023 16:31
Co-authored-by: Donghee Na <donghee.na@python.org>

@corona10corona10 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@aisk

aisk commented Nov 19, 2023

Copy link
Copy Markdown
MemberAuthor

Thanks for the review!

@aisk
aisk deleted the critical-sections-textiowrapper branch November 19, 2023 06:56
aisk added a commit to aisk/cpython that referenced this pull request Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@aisk@colesbury@corona10