For example, suppose an object provides a synchronized method that often takes a long time to return.
比如,假如有一个同步方法通常需要很长时间才返回。
Methods that are not synchronized may still execute at any time, even if a synchronized method is in progress.
如果一个同步方法正在执行中,其他的非同步方法也可以在任何时候执行。
One well-known source has cited that a synchronized method call is as much as 50 times slower than an unsynchronized method call.
一个著名的资料来源就曾经引证说一个同步的方法调用比一个非同步的方法调用慢 50 倍。
应用推荐