线程安全在运行时还具有性能牵连。
Thread safety also has performance implications at run time.
注意这样的代码是完全线程安全的。
很轻量但是并不是线程安全的。
这表示下面的代码不是线程安全的。
What this means is that the following code is not thread safe!
它线程安全,而且更节省资源。
清单3说明如何使用此线程安全版本。
为数据存储库使用线程安全的包装器。
线程安全是自动实现的。
(不可变类的一个优点就是它们是线程安全的)。
One advantage of immutable classes is that they are thread-safe.
因此ibinder方法必须实现为线程安全的。
IBinder methods must, therefore, be implemented to be thread-safe.
放到会话中的对象应该是线程安全的和可序列化的。
Objects that you put on the session should be thread-safe and serializable.
使一个类线程安全需要在实现和测试该类时非常小心。
Making a class thread safe requires additional care during the implementation and testing of the class.
清单1显示了一个非线程安全的数值范围类。
此外,Andoid的UI组件包并不是线程安全的。
对象池需要跟踪每个对象的状态,而且应该是线程安全的。
The object pool needs to keep track of the state of each object and to be thread safe.
所有只读的树操作都是线程安全的,只要没有线程修改它。
Any read-only tree operation is thread-safe as long as there isn't any thread modifying it.
在需要线程安全的情况下,请使用线程安全视图。
In situations where you know you need thread safety, use a thread-safe view.
尽管我们常用线程安全描述代码,但实际上它是描述数据的。
While thread-safety is a term we typically use to describe code, in actuality it is about data.
一般而言,在保证线程安全的前提下要尽可能地简化同步语句。
In general, strive to make your synchronized blocks as lean as possible, without harming thread safety.
另外,或许不可能让某个不可重入的函数是线程安全的。
Moreover, it may be impossible to make a non-reentrant function thread-safe.
举例来说,考虑一下线程安全的StringBuffer的用法。
具体来说,线程安全是指适当地协调对被多个线程访问的可变数据的访问。
Specifically, thread safety is about properly coordinating access to mutable data that is accessed by multiple threads.
因为这些方法可能会从很多线程同时调用,它们也必须实现为线程安全的。
Because these methods might be called from any number of threads at the same time, they too must be implemented to be thread-safe.
在本文中,您将学习如何构建线程安全的数据存储库来自动保存表单数据。
In this article, you'll learn how to build a thread-safe data repository for keeping auto-saved form data.
从MVM的角度来看,我们不需要关注线程安全,但是需要考虑VM通讯。
On MVM side, we don't need to care about thread-safety, but VM communications.
管理非线程安全类的使用比试图使类成为线程安全的要更容易些。
It may be easier to manage the use of a non-thread-safe class than to try and make the class thread-safe.
批处理应用程序开发人员可以编写线程安全的、且在单个线程中执行的代码。
Batch application developers write code that is thread-safe and executes on a single thread.
您还应该记得,在方法调用之间保留状态的静态类在默认情况下应该是线程安全的。
You should also remember that static classes that preserve state between method calls should be made thread safe by default.
您还应该记得,在方法调用之间保留状态的静态类在默认情况下应该是线程安全的。
You should also remember that static classes that preserve state between method calls should be made thread safe by default.
应用推荐