You can think about multithread(原文是it,我把它替换为multithread) in "pizza terms". You went to pizza cafe, and couple of other guys entered with you as well. Each one placed his order and then sat to his own table. Pizza boxes to be arrived then and each of you start eating his own meal.
Here, the cafe is a singleton, pizza boys are CPU cores, you and other customers are threads, orders and pizza are input and output data respectively, table is a piece of memory.
As you can see, each thread is served with his own piece of memory so
CPU can distinguish your data and don't mix up. As you asked about
stack, it's not a significant player here because each thread has it's
own stack (as a part of your memory chunk).
原文标题是:how multiple threads invoke singleton object's method and work on them?
原文出自stackoverflow,地址我就不加了。因为我怕这篇文章审核不通过!
作为一个人类,我们经常受到这种审核的约束!