3 ms·
Why do you insist? Please argue with the POSIX people writing these manpages (and correct Wikipedia) if you think that they are all wrong and your nomenclature
by jstimpfle 11y ago
Why do you insist? Please argue with the POSIX people writing these manpages (and correct Wikipedia) if you think that they are all wrong and your nomenclature is the right one.
What you talk about are pure functions.
- kazinator 11y agoOnly pure functions are absolutely reentrant. Reentrancy is logically weaker than thread safety. For instance, malloc is thread safe in POSIX, right? Yet, you cannot call it from a signal handler, at least not an asynchronous one. This is because it isn't reentrant. (POSIX would call it "async signal safe", but that's totally POSIX-specific terminology. POSIX uses some terms in POSIX specific ways, unsurprisingly. And "async signal safe" is something less than reentrant because functions can be made async signal safe by manipulating signal masks to avoid being re-entered.) I'm not the one who made this discussion about POSIX; my original comment wasn't about how POSIX uses "reentrant" (and I don't care, for that matter).
- jstimpfle 11y ago> Reentrancy is logically weaker than thread safety. It isn't; neither is an implication of the other. If you mistrust manpages, lookup the definition on Wikipedia. But in many contexts "reentrant" is the better "thread-safe", as in "what you actually want" (give up mandatory locks to get scalability, composability...).
- kazinator 11y agoDo you have an example of a function inherently reentrant (pure function), or a function or object used in a reentrant manner, that isn't also thread-safe? Wikipedia's first paragraph on Reentrancy completely agrees with me; I'm not inclined to change a word. POSIX doesn't define "reentrancy" or "reentrant", though it uses those terms. They are not defined in the documents it includes by normative reference. ISO C is one of those references and also throws the word around. ISO C refers to a document called ISO 2382, whose Part 1 gives a technical vocabulary; it might be defined there. By POSIX, of course I don't mean the man pages on a Linux system, but the actual specification. I refer the online version from time to time, specifically this one: http://pubs.opengroup.org/onlinepubs/9699919799/ http://pubs.opengroup.org/onlinepubs/9699919799/