If you are going to hold the lock on the collection during an entire iteration, then other threads may be stalled waiting for the collection lock for a long time.
如果您要在整个迭代期间都保持对集合的锁,那么其他的线程就会在锁外停留很长的一段时间,等待解锁。
The race conditions illustrated in Listing 1 often make it necessary to hold the single collection lock for much longer than it takes to execute a single operation.
清单1中演示的争用条件常常使得对单个集合的锁在单个操作执行完毕之后还必须继续保持一段较长的时间。
This special museum has a collection of objects from people all over the world who want to lock their memories.
这个特殊的博物馆收藏了来自世界各地想要锁定记忆的人们的物品。
If the NHRT is delayed when trying to acquire such a lock while the thread owning the lock is delayed by garbage collection, then the NHRT is indirectly delayed by garbage collection as well.
如果NHRT在尝试获取这类锁时被延迟了,而且拥有该锁的线程被垃圾收集延迟了,那么垃圾收集也会间接地延迟NHRT。
Health Center also features lock analysis for identifying synchronization bottlenecks, and a garbage collection perspective, which can spot when garbage collection is causing application slowdowns.
HealthCenter还具有锁分析特性,可用于确定同步瓶颈;一个垃圾收集透视图,可用于确定垃圾收集导致应用程序性能降低的时刻。
This means that multiple threads can access different portions of the Map simultaneously, without contending for the single collection-wide lock.
这意味着多个线程可以同时地访问一个Map的不同部分,而不必争用单个的集合范围的锁。
To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads.
若要确保枚举过程中的线程安全性,可以在整个枚举期间锁定集合,或者捕获由其他线程进行的更改所导致的异常。
That is, do not hold a lock if the owning thread might make a call that triggers a garbage collection.
也就是说,如果拥有的线程可能进行触发垃圾回收的调用,请不要持有锁。
Do not hold a lock while your profiler calls into a CLR function that can trigger a garbage collection.
当探查器调入可能触发垃圾回收的clr函数时,不要持有锁。
To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions that result from changes made by other threads.
若要保证列举期间的安全执行绪,您可以在整个列举期间锁定集合,或拦截由其他执行绪所做变更造成的例外状况。
Anxin Lock industry co., Ltd. is located in the country's most economically dynamic city - Wenzhou, Zhejiang, is a collection Branch, industry and trade into an integrated enterprise.
安信锁业有限公司座落于全国最具经济活力的城市——浙江温州,是一家集科、工、贸于一体的综合性企业。
Anxin Lock industry co., Ltd. is located in the country's most economically dynamic city - Wenzhou, Zhejiang, is a collection Branch, industry and trade into an integrated enterprise.
安信锁业有限公司座落于全国最具经济活力的城市——浙江温州,是一家集科、工、贸于一体的综合性企业。
应用推荐