GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-116738: Make syslog module thread-safe by yoney · Pull Request #136760 · python/cpython Conversation
|
| #ifdef __APPLE__ | |
| // gh-98178: On macOS, libc syslog() is not thread-safe | |
| syslog(priority, "%s", message); | |
| #else |
I will check/test the macOS subinterpreter and create a separate PR if necessary.
cc: @mpage @colesbury
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I'm wondering whether these functions are thread safe on other UNIX-like platforms, but I found that on some BSDs (OpenBSD1 and NetBSD) and on AIX2, some of these syslog related functions are not thread safe, and they provide alternative versions with the I'm not sure whether we should add locks for these functions on these platforms, or change the implementations to the But these platforms are not marked as supported in PEP113, so I think this is may not be a big issue for now. Footnotes |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@aisk - I think the current implementation should be thread-safe on those platforms on both builds. The GIL provides thread safety on the default build; a critical section provides thread-safety on the free-threaded builds. There is one notable exception, cpython/Modules/syslogmodule.c Lines 242 to 249 in 5f9e38f
I think we can address that in a follow up, if needed. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Make the setlogmask() function in the syslog module thread-safe. These changes are relevant for scenarios where the GIL is disabled or when using subinterpreters.
Make the setlogmask() function in the syslog module thread-safe. These changes are relevant for scenarios where the GIL is disabled or when using subinterpreters.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.