It's thread-safe and has a smaller footprint.
它线程安全,而且更节省资源。
Using a thread-safe wrapper for the data repository.
为数据存储库使用线程安全的包装器。
Listing 1 shows a non-thread-safe number range class.
清单1显示了一个非线程安全的数值范围类。
Additionally, the Andoid UI toolkit is not thread-safe.
此外,Andoid的UI组件包并不是线程安全的。
Listing 3 shows you how to use this thread-safe version.
清单3说明如何使用此线程安全版本。
One advantage of immutable classes is that they are thread-safe.
(不可变类的一个优点就是它们是线程安全的)。
IBinder methods must, therefore, be implemented to be thread-safe.
因此ibinder方法必须实现为线程安全的。
Objects that you put on the session should be thread-safe and serializable.
放到会话中的对象应该是线程安全的和可序列化的。
In situations where you know you need thread safety, use a thread-safe view.
在需要线程安全的情况下,请使用线程安全视图。
Moreover, it may be impossible to make a non-reentrant function thread-safe.
另外,或许不可能让某个不可重入的函数是线程安全的。
One common use is for storing a singleton of a type that is not thread-safe.
一种常见用法是用于存储非线程安全类型的单例。
Any read-only tree operation is thread-safe as long as there isn't any thread modifying it.
所有只读的树操作都是线程安全的,只要没有线程修改它。
Batch application developers write code that is thread-safe and executes on a single thread.
批处理应用程序开发人员可以编写线程安全的、且在单个线程中执行的代码。
The first condition disqualifies volatile variables from being used as thread-safe counters.
第一个条件的限制使volatile变量不能用作线程安全计数器。
The DataMapRepository class presented previously and its base class LinkedHashMap are not thread-safe.
之前介绍过的datamaprepository类及其基类LinkedHashMap都不是线程安全的。
Consider a thread-safe container class - a data structure that guarantees thread safety to its clients.
可以考虑使用一个线程安全容器类—一个保证用户操作线程安全的数据结构。
They all output the same value illustrating that this is a thread-safe generic way to create singletons.
所有线程都返回相同的值,这说明这是一个线程安全的使用泛型来实现的单态模式。
It may be easier to manage the use of a non-thread-safe class than to try and make the class thread-safe.
管理非线程安全类的使用比试图使类成为线程安全的要更容易些。
In this article, you'll learn how to build a thread-safe data repository for keeping auto-saved form data.
在本文中,您将学习如何构建线程安全的数据存储库来自动保存表单数据。
In its simplest mode it ACTS as a thread-safe queue in which consumers are blocked while the queue is empty.
它最简单的使用模式便是作为一个线程安全的队列,并且在队列为空时阻塞消费者。
While the JLS gives us tools with which we can make our programs thread-safe, thread-safety does not come free.
虽然JLS给了我们可以使我们的程序线程安全的工具,但线程安全也不是天上掉下来的馅饼。
Concurrent Collections make concurrent programming easier by providing thread-safe, well-tuned data structures.
并发Collections提供了线程安全、经过良好调优的数据结构,简化了并发编程。
There is no straightforward way to make the code in Listing 1 thread-safe, making this idiom an accident waiting to happen.
没有直观的途径来使清单1中的代码是线程安全的,这使这种语言风格成为了一种等待时机发生的事故。
You may have occasionally pondered whether to synchronize an entire method call or only the thread-safe subset of that method.
您可能偶尔会思考是否要同步化这个方法调用,还是只同步化该方法的线程安全子集。
Sometimes, it is very difficult to make a class thread-safe without compromising its functionality, ease of use, or performance.
有时,要在不影响类的功能、易用性或性能的情况下使类成为线程安全的是很困难的。
Many people are betting on functional programming, with its emphasis on immutable objects and their inherently thread-safe properties.
很多人现在都投身于函数式编程的世界,由于它们具有不可变的对象,以及与生俱来的线程安全属性。
In some situations, the methods you implement might be called from more than one thread, and therefore must be written to be thread-safe.
在某些场合,方法可能会从不止一个线程中被调用,因此这些方法必须是写成线程安全的。
It is often the easiest way to render a stateful class thread-safe, or to encapsulate non-thread-safe classes so that they can safely be used in multithreaded environments.
它常常是把有状态类描绘成线程安全的,或者封装非线程安全类以使它们能够在多线程环境中安全地使用的最容易的方式。
It is often the easiest way to render a stateful class thread-safe, or to encapsulate non-thread-safe classes so that they can safely be used in multithreaded environments.
它常常是把有状态类描绘成线程安全的,或者封装非线程安全类以使它们能够在多线程环境中安全地使用的最容易的方式。
应用推荐