at the very least, document the thread safety guarantees made by a class.
最起码,记录下一个类的线程安全的保证性。
doug cutting has posted on the topic of thread safety a couple of times.
dougcutting曾几次发表线程安全性的主题。
consider a thread-safe container class — a data structure that guarantees thread safety to its clients.
可以考虑使用一个线程安全容器类 —一个保证用户操作线程安全的数据结构。
analyzing the thread safety of a program that uses containers is harder with intrusive containers, because the container might be modified indirectly without an explicit call to a container member.
分析一个使用容器的程序的线程安全要比分析介入式容器更困难,因为可以无需显式调用容器的成员函数就间接修改该容器。
thread safety in the current version of the framework is also questionable.
该框架的当前版本还存在线程安全问题。
inserting an object in containers that will be modified by different threads has no thread safety guarantee, although in most platforms it will be thread-safe without locking.
向一个会被其它线程修改的容器插入对象是没有线程安全性保证的,虽然在多数平台上,它是无锁定线程安全的。
the fact that get() may take significant time to execute in some cases is made significantly worse by the conditional thread safety problem discussed above.
get()执行起来可能会占用大量的时间,而在某些情况下,前面已经作了讨论的有条件的线程安全性问题会让这个问题变得还要糟糕得多。
intrusive containers have thread safety guarantees similar to stl containers.
介入式容器具有与stl容器相似的线程安全性保证。
in some scenarios, this can result in a big win that outweighs the cost of the extra thread safety work.
在某些情况下,这会大大提高性能,即使在线程安全性上有额外的开销。
thread safety is automatic.
线程安全是自动实现的。
defining thread safety is surprisingly tricky.
线程安全的定义出奇的复杂。
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.
若要确保枚举过程中的线程安全性,可以在整个枚举期间锁定集合,或者捕获由其他线程进行的更改所导致的异常。
free-threaded documents are generally slower than rental documents because of the extra thread safety work they do.
自由线程文档一般比租用线程文档要慢,因为它要为线程安全性增加开销。
specifically, thread safety is about properly coordinating access to mutable data that is accessed by multiple threads.
具体来说,线程安全是指适当地协调对被多个线程访问的可变数据的访问。
if our definition of thread safety is fuzzy, it is because we lack a clear definition of correctness.
如果我们关于线程安全的定义是模糊的,那通常是因为我们缺少了对正确性的定义。
our api adds thread safety to all shared objects in a way that makes coding for server usage natural and performant.
我们的api为所有的共享对象加入了线程安全,使得为服务器运用编程更加自然高效。
as soon as you implement a nontrivial class maintaining state between method calls, consumers of the class will want to know details about thread safety and performance.
一旦您实现了在方法调用之间保持状态的重要类,该类的使用者就会希望了解有关线程安全和性能的详细信息。
at the heart of any reasonable definition of thread safety is the concept of correctness.
任何针对线程安全的合理定义中,正确性都应该是核心内容。