In other words, it is necessary that the thread blocks access to the object for other threads while working with it. It is a lot of objects, therefore the variant with use mutex'ov for everyone will not be suitable. In java, this would be pretty simple with the synchronized () {} construct

  • And Java does not create on muteks on object? Creates IMHO. Maybe openmpi atomik fit? Describe the task in more detail, will tell. And here they make a macro - eri
  • Java simply shoves a syncing primitive into every object with no interest in the programmer’s opinion at all. And in C ++, you have the ability to implement synchronization efficiently. - VTT
  • No, there is no analog in C ++. - ixSci

0