Hello!
Started learning streams. The author of the course, which I pass, gave an example of working with static methods with multithreading. He noted that although the static method usually exists in a single copy (since it belongs to the entire object), when this method is executed in two threads, a copy of the method is created for each of them; the author notes that the word “copy” is used for a simplified understanding in this educational material, after which I quote:
In fact, very tricky processes are occurring - such as with the local storage of a stream while preserving intermediate register calculations - since IT IS EVERYTHING EACH OF THE STATIC METHOD. But thanks to these complex processes and mechanisms, we have the illusion that the static method is being copied. ... But we, as high-level programmers, are not interested.
What are these mechanisms? How are they used to create the illusion of a copy of the static method? And what have the “flow storage while keeping intermediate register calculations”? What is this storage?
At another forum, we noticed that the author had in mind that neither the usual methods of classes nor the static ones are copied.
Perhaps it meant a stack that the system creates for each thread; but the stack is not a copy. Then I don’t know what the author of the course meant - he said that it is the static methods that have some mechanisms that create the illusion of copying them.
If the author is still wrong, I ask you to define the concepts from the quotation and explain what the author wanted to say. Thank you in advance!