Discussion Overview
The discussion centers around the reentrancy of std::bind in C++, exploring whether it can be safely called in concurrent contexts or during its own execution. Participants examine the implications of bound arguments and the behavior of std::bind in various scenarios, including recursion and multi-threading.
Discussion Character
- Debate/contested
- Technical explanation
- Conceptual clarification
Main Points Raised
- Some participants question whether std::bind is reentrant, suggesting that bound values must be stored somewhere.
- One participant asserts that all information is stored in the object returned by std::bind.
- Another participant expresses uncertainty about how to retrieve bound arguments from the returned object.
- A participant recalls past debates regarding the recursive use of std::bind and its unclear consequences.
- Some participants discuss the implications of not being able to retrieve bound arguments and whether this affects reentrancy.
- It is noted that std::bind does not call itself, which may contribute to its reentrancy in multi-threaded contexts.
- Concerns are raised about the use of global variables and non-reentrant functions in determining the reentrancy of a function.
Areas of Agreement / Disagreement
Participants express differing views on the reentrancy of std::bind, with some suggesting it is reentrant under certain conditions, while others remain uncertain about the implications of bound arguments and the behavior of std::bind in various contexts. The discussion does not reach a consensus.
Contextual Notes
Participants mention that the implementation details of std::bind may vary, particularly in relation to specific compilers like Visual C++ 2017. There are also references to the need for further testing and analysis to determine reentrancy based on the use of global variables and other factors.