盘可以储存数据10年或更久,但是连接器容易损坏,导致无法读取数据。
USB drives can store data for ten years or longer, however the connectors can get damaged, rendering them unreadable.
现在run方法可以访问counter变量了(仅仅是读取而已),但却无法更新该变量,因为它是final的,这又导致了另一个编译错误!
Now we can access it (i.e., read it) but we can't update it because the variable is final; another compiler error!
即,允许一些读取器在其他读取器锁定时运行效率更高,但是您可能会有读取器线程的流持续不断的风险,导致编写器无法进行工作。
That is, it would be more efficient to allow readers to run while other readers held the lock, but you'd risk a constant stream of reader threads keeping the writer from ever doing its job.
应用推荐