New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a new class to write multi-thread safe to a complete directory #32344
Comments
Branch: u/soehms/atomic_dir_32344 |
New commits:
|
Author: Sebastian Oehms |
Commit: |
comment:3
Haven't tried yet, but this part:
looks racy to me |
comment:4
Replying to @mkoeppe:
This code is just adapted from the corresponding part of
Unfortunately, the traceback doesn't show how this is caused by my code. Do you have any ideas on how to make this part more safe? |
comment:5
I think a first step should be to clarify the semantics in the documentation of this class: This is for creating a directory whose contents are determined uniquely by the directory name. If multiple threads or processes attempt to create it in parallel, then it does not matter which thread created it. If this is the intended semantics, then the following should be correct:
|
comment:7
Replying to @mkoeppe:
Good idea! If cleaning is necessary then the calling code is responsible. If so, it can still lead to a race of removing the directory but under better controlled conditions. |
Reviewer: Matthias Koeppe |
comment:9
LGTM |
comment:10
Many thanks! |
Changed branch from u/soehms/atomic_dir_32344 to |
Changed keywords from atomic write directory tempory to atomic write, directory, temporary |
Changed commit from |
This new class is just a variation of the existing class
atomic_write
taking care of directory specific differences.For a first application case see #32099.
Component: doctest framework
Keywords: atomic write, directory, temporary
Author: Sebastian Oehms
Branch:
6d4693d
Reviewer: Matthias Koeppe
Issue created by migration from https://trac.sagemath.org/ticket/32344
The text was updated successfully, but these errors were encountered: