因此,您不应依赖于类构造函数来初始化线程相关的静态字段。
Therefore, you should not rely on class constructors to initialize thread-relative static fields.
在正确初始化和处理NotesThreads以及离开初始化线程之间,我们陷入了两难的境地,但可能会造成LotusDomino服务器的不稳定。
We faced a dilemma between properly initializing and disposing of NotesThreads and leaving the threads initialized, but resulting in a possibly unstable Lotus Domino server.
类似地,在初始化期间可以创建一个解析器池(每个线程创建一个)。
Similarly, you can create a pool of parsers-one per thread-at initialization time.
如果初始化的代价高昂,或者从多个线程中同时调用该代码,则这一重复创建的影响仍然可能成为问题。
If the initialization is expensive, or the code is called simultaneously from multiple threads, the impact of this repeated creation may still be an issue.
还有一种可能是在启动时派生一个单独的低优先级的线程,当系统空闲时再去完成初始化,不过这种方法需要特别注意处理好同步。
Another possibility is to fork a separate low-priority thread during startup to perform initialization when the system is idle, although this choice requires more care to handle synchronization.
您可以通过从一个高优先级rt线程执行应用程序初始化来避免这个问题。
You can avoid this problem by performing application initialization from a high-priority RT thread.
用来对这些线程进行初始化和销毁的代码都在 #ifdef INTR_SIMULATION 之下,这样在普通模式下编译的代码不会影响驱动程序对象的发行版本。
The code to initialize and destroy the threads will be under #ifdef INTR_SIMULATION, so that under normal compilation this code will not affect the release version of the driver object.
ThreadLocal变量与常规变量的不同之处在于,每个线程都有其各自初始化的变量实例,这通过get()或set()方法予以评估。
ThreadLocal variables are different from normal variables in that each thread has its own individually initialized instance of the variable, which it accesses via get() or set() methods.
如果no -os线程变量在初始化变量结构中已经设置,对C_Initialize的调用将会失败。
If the no-os threads argument is set in the initialize arguments structure, the call to C_Initialize will fail.
使用调试方法确认了我们的猜测,一些线程用于促进HTTP请求,并且各线程都要求LotusNotes初始化。
Using the debugging perspective confirmed our suspicion that several threads were used to facilitate HTTP requests with each thread requiring Lotus Notes initialization.
线程1通过运行Singleton对象的构造函数并将引用返回给它,来完成对该对象的初始化。
Thread 1 completes the initialization of the Singleton object by running its constructor and returns a reference to it.
类初始化任何类型的常规或实时线程都可以初始化类,包括NHRT(它可能导致意外的MemoryAccessError)。
Class initialization Any type of regular or real-time thread can initialize a class, including a NHRT, which can cause unexpected MemoryAccessError.
我们的意图是在Zero中接收到传入请求时初始化zeroHTTP线程,随后处理NotesThread并呈现输出。
Our intention is to initialize the Zero HTTP thread when the incoming request is received in Zero and subsequently dispose of the NotesThread prior to rendering the output.
这两者都体现了延迟初始化的特性(因此又被称为futures)。前者是一个类,而后者则是一个轻量的,但并非“绝对”线程安全的结构。
Both support the idea of deferred initialization, also known as futures, the former is a class and the later a lightweight and slightly less safe structure.
这样我们将可以传递实现每一个子线程初始化的场所对象。
Then we can pass along the locale object with each child thread initiation.
首先,它初始化这些系统类不需要线程支持来执行这些静态的初始化。
First, it initializes those system classes that don't require thread support by executing their static initializers.
现在只剩下两个次要的任务 ——初始化互斥锁和启动线程运行可上传的文件的列表。
This just leaves us with a couple of minor bookkeeping tasks -- initializing the mutex and starting a thread to run through the list of uploadable files.
一旦线程被初始化,它们2个就作为一对存在。
Once the thread is properly initialized, the 2 will always exist as a pair.
完成初始化之后,HTTP线程必须得到正确处理。
The HTTP threads, once initialized, must be properly disposed.
然后,一个线程进入synchronized块来初始化instance,而另一个线程则被阻断。
Then, one thread enters the synchronized block to initialize instance, while the other is blocked.
即使不使用多线程处理,也要预先初始化xerces - C+ +以避免多次调用这个函数,然后在应用程序结束时将其终止。
Even if you don't use multithreading, initialize Xerces-C + + up front to avoid multiple calls to this function and then terminate when your application terminates.
不使用双重检查锁定,而使用Initialize - on - demandHolderClassidiom,它提供了迟缓初始化,是线程安全的,而且比双重检查锁定更快且没那么混乱。
Instead of double-checked locking, use the Initialize-on-demand Holder Class idiom, which provides lazy initialization, is thread-safe, and is faster and less confusing than double-checked locking.
在使用自定义组件范围的线程池(图3)时,将使用WorkManager创建的守护程序线程初始化池中的每个工作线程。
When using custom component-scoped thread pools (Figure 3), each worker thread in the pool is initialized with a daemon thread created by the WorkManager.
这些指令大多数是为了检查i的初始化,以及使用锁执行线程安全的初始化。
Most of these instructions are in place to check for the initialization of I, and to perform a thread-safe initialization using a lock.
如何等待其他线程初始化和清理正确之后?
How to wait for other thread to init and clean up correctly afterwards?
为什么是一个对象,有时无效,当它被初始化一个线程访问从主?
Why is an object sometimes null, when it gets initialized in a thread and accessed from main?
然而,如何运行这两个指标同时显示的初始化和忙吗?看来我需要不同的线程来处理这个问题。
However, how to run both the initialization and the display of busy indicator simultaneously? It seems that I need different threads to handle this issue.
此初始调用确保在不死锁的情况下,完成每个线程初始化。
This initial call ensures that the per-thread initialization can complete without deadlock.
进程交换(注入)一个新的线程,每线程初始化要执行。
The process is spawning a new thread. Any per-thread initialization should be performed.
如果没有使用COM互操作,则不初始化该线程。
If COM interop is not used, then the thread is not initialized.
应用推荐