How does Thread.sleep() work when called from multiple threads
问题 sleep() is a static method of class Thread. How does it work when called from multiple threads. and how does it figure out the current thread of execution. ? or may be a more generic Question would be How are static methods called from different threads ? Won't there be any concurrency problems ? 回答1: how does it figure out the current thread of execution? It doesn't have to. It just calls the operating system, which always sleeps the thread that called it. 回答2: The sleep method sleeps the