[argobots-discuss] Can I move a static mutex around in memory?

Dorier, Matthieu mdorier at anl.gov
Tue Jun 15 07:04:39 CDT 2021


Hi,

I would like to understand statically initialized mutex and condition variables better, in particular: can I move them around in memory (assuming all the ULTs in my code have a consistent way of locating them)?

This would come up in C++ containers, for instance:
std::vector<ABT_mutex_memory>
If I increase the size of the vector, reallocation may take place, and the existing mutexes will be moved somewhere else in memory. Assuming all the ULTs are accessing them by their index in the vector rather than by an ABT_mutex opaque pointer, then this should be fine as long as I am allowed to move ABT_mutex_memory around (regardless of their state). Is that the case?

Same question for condition variables?

Thanks,

Matthieu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.argobots.org/pipermail/discuss/attachments/20210615/87a3a8e5/attachment.html>


More information about the discuss mailing list