V
V
Vitaly2016-12-15 19:47:51
Java
Vitaly, 2016-12-15 19:47:51

How are nested objects handled in multithreaded programming?

The question is more about C#, but answers from other languages ​​will do - the principle is important. If the question is unclear, please clarify.
Example:
object 1
- object 2
object 3 - object
2
object 4 - object
1
object 5
- object 3 streams. The mutex provides a shield for objects 1 and 3, but they, in turn, access the unshielded shared object 2 Question: how to properly place locks so that, on the one hand, you don’t miss such situations, and on the other hand, you don’t start mutating each object in the program.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MrDywar Pichugin, 2016-12-15
@Dywar

Objects in the singular and contain fields that change from different places in parallel?
Objects nested or not are treated the same, the whole problem lies in accessing the same address in memory for writing simultaneously from different threads of execution, when a multi-core processor tries to write to the same address by different cores.
Such addresses are fields of objects.
The task is not entirely clear, there is little data.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question