Suppose I have a 2 dimension vector
vector< vector< int> > v
Then thread 1 operate on v[0], like
v[0].append(x)
thread 2 operate on v[1],
v[1].remove(y)
etc.
Is this operation thread safe? I suppose it is, as v[0] and v[1] are separate pointers which point to different memory? but not sure.
Aucun commentaire:
Enregistrer un commentaire