langpackage提供了线程类,支持开始,停止进程,设置进程优先级等等。
The java.lang package provides a thread class that supports methods to start and stop threads and set thread priorities, among other things.
无需为委托创建更多方法,线程类即可创建一个线程并且包含该线程执行的代码。
This class creates a thread and also contains the code that the thread executes without creating an additional method for the delegate.
将经过填充数据的实例传递给线程类,后者是通过继承threading . thread的方式创建的。
Pass that instance of populated data into the threading class that you created from inheriting from threading.Thread.
在本例中,委托模型是一个正确的图(带有循环),所以死锁的发生可能是使用特定的类关系和线程的结果。
In this case, the delegation model is a proper graph (with cycles), and so a deadlock can occur as a result of particular class relationships and thread usage.
该定时器类的实例能够被多个线程安全地访问。
Instances of this timer class can be safely accessed from multiple threads.
(不可变类的一个优点就是它们是线程安全的)。
One advantage of immutable classes is that they are thread-safe.
这个回调处理器类拥有两个线程本地变量,用于存储来自客户端实例的用户ID和密码。
The callback handler class has two thread local variables that can store the user ID and password from the client instance.
首先,它初始化这些系统类不需要线程支持来执行这些静态的初始化。
First, it initializes those system classes that don't require thread support by executing their static initializers.
挑战在于,您需要跨多个线程协调多个类中的多个方法。
The challenge is that you need to coordinate multiple methods in multiple classes across multiple threads.
可以考虑使用一个线程安全容器类—一个保证用户操作线程安全的数据结构。
Consider a thread-safe container class - a data structure that guarantees thread safety to its clients.
这个实例被用于发送到该分区中的所有消息,使这个类的成员线程安全并提供缓存必要资源的机会。
This instance is used for all messages that are sent into the partition, making members of this class thread safe and providing the opportunity to cache required resources.
请注意,同步请求是在调用类的线程上处理的。
Note that a synchronous request is processed on the calling class's thread.
工厂类保留已连接的线程的静态映射,可以在线程进行调用时返回现有连接句柄,或创建并存储连接句柄。
The factory class keeps a static map of the threads that have been connected and can either return the existing connection handle, or create and store the connection handle when called by a thread.
它提供了有关JVM的详细信息,包括总的运行时间、线程信息、装载的类、内存统计信息、垃圾收集和操作系统信息。
It provides detailed information about the JVM, including total uptime, threading information, classes loaded, memory statistics, garbage collection, and operating-system information.
接下来,对于另一个线程池类DatamineThread,几乎复制了完全相同的结构。
Next, you almost copy the exact same structure for the next thread pool class, DatamineThread.
Overview选项卡以图形的格式显示有关内存使用、线程、类和CPU 使用情况的信息。
The Overview tab displays correlated information about memory usage, threads, classes, and CPU usage in a graphical format.
分析这段代码时您可以看到,我们添加了另一个队列实例,然后将该队列传递给第一个线程池类ThreadURL。
In looking at the code, you can see that we added another instance of a queue, and then passed that queue into the first thread pool class, ThreadURL.
每个工作者线程使用taskhandler类执行一部分工作。
Each worker thread performs some bit of work using the TaskHandler class.
使用Executors工具类来创建线程池,而不是直接调用ThreadPoolExecut or构造器来创建。
You don't call the ThreadPoolExecutor constructor directly to create a thread pool but instead use the Executors utility class to create one.
Handler类允许您在线程之间协调和通信。
The android.os.Handler class allows you to coordinate and communicate between threads.
您可以用如清单4所示的DebugLogger类作为线程局部容器来累积调试信息。
You could accumulate debugging information in a thread-local container as shown by the DebugLogger class in Listing 4.
Volta类库不支持多线程。
另一个常见的线程模型是为某一类型的任务分配一个后台线程与任务队列。
Another common threading model is to have a single background thread and task queue for tasks of a certain type.
有些类保留从一个方法调用到下一个方法调用的状态信息,要在实践中使这样的类成为线程安全的是困难的。
Some classes retain state information from one method invocation to the next, and it is difficult to make such classes thread-safe in any practical way.
它常常是把有状态类描绘成线程安全的,或者封装非线程安全类以使它们能够在多线程环境中安全地使用的最容易的方式。
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.
有时,要在不影响类的功能、易用性或性能的情况下使类成为线程安全的是很困难的。
Sometimes, it is very difficult to make a class thread-safe without compromising its functionality, ease of use, or performance.
非线程安全类通常可以安全地在多线程程序中使用,只要您能确保一个线程所用的类的实例不被其它线程使用。
A class that is not thread-safe can often be used safely in a multithreaded program as long as you ensure that instances of that class used by one thread are not used by other threads.
你是否需要让你的类是单线程的?或者允许WCF能够在同一时间有多个实例?
Do you need to single-thread your classes or can you allow WCF to spin up multiple instances simultaneously?
类加载器的父类加载器将是当前线程上下文的类加载器。
The parent of this class loader will be the class loader of the current thread context.
类加载器的父类加载器将是当前线程上下文的类加载器。
The parent of this class loader will be the class loader of the current thread context.
应用推荐