Skip to content
Snippets Groups Projects
Commit aa9408f1 authored by Carsten Gräser's avatar Carsten Gräser
Browse files

[doc] Document thread safety guarantees of MatrixIndexSet

parent 107a54a8
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,10 @@ namespace Dune {
* The default value for maxVectorSize works well and ensures
* that the slow std::set fallback is only used for very
* dense rows.
*
* This class is thread safe in the sense that concurrent calls
* to all const methods and furthermore to add(row,col) with different
* rows in each thread are safe.
*/
class MatrixIndexSet
{
......@@ -98,7 +102,13 @@ namespace Dune {
indices_.resize(rows_, FlatSet());
}
/** \brief Add an index to the index set */
/**
* \brief Add an index to the index set
*
* It is safe to call add(row, col) for different rows in concurrent threads,
* but it is not safe to do concurrent calls for the same row, even for different
* columns.
*/
void add(size_type row, size_type col) {
return std::visit(Dune::overload(
// If row is stored as set, call insert directly
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment