libelektra
libelektra copied to clipboard
Internal Refactoring for better thread safety
As the API discussions are still ongoing and an agreement on the full API will probably take some time (I still suggest to pick smaller changes which have a clear problem), I suggest that you start with internal refactoring to get the development of the refactoring tool going so that we see what it actually can do.
Following points came to my mind:
- [ ] #4870
usage of thread safe functions everywhere, especially strerror_r. Systematically search for all occurrences of POSIX functions that have a
_rversion (can be found out withapropos). - [x] #4466
Imho this is the most important problem, which leads to easily reproducible crashes if two threads do something with
KDB. I am not sure, however, if and how automatic refactoring can be helpful there. - [x] #4869 search for all global variables. If there are any, please report and let us discuss if automatic refactoring makes sense.
usage of thread safe functions everywhere
Yes, that seems like a pretty good showcase example.
Imho the most important problem is
If you're using TOML and see it as an important problem, why not create a PR yourself? The issue already suggests what needs to be done and it shouldn't be too hard to do.
In any case, even if this could be automated, I think doing it by hand is much quicker and easier.
search for all global variables
Finding global variables should work with plain tree-sitter, no need for the tool I'm working on. Refactoring probably can't be automated here either, since what should be done very much depends on what the variable is used for. The only thing that might be automatable would be adding thread_local, but that might not work for all cases and also needs C11 (which I'm not sure if we want to require).
Moved to https://github.com/ElektraInitiative/libelektra/issues/4870#issue-1620377910
Moved to https://github.com/ElektraInitiative/libelektra/issues/4869#issuecomment-1465208310
I mark this stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping by writing a message here or create a new issue with the remainder of this issue. Thank you for your contributions :sparkling_heart:
I closed this now because it has been inactive for more than one year. If I closed it by mistake, please do not hesitate to reopen it or create a new issue with the remainder of this issue. Thank you for your contributions :sparkling_heart: