显然,这样做并不理想,因为当编程人员期望执行终止线程时,它可能不执行。
Clearly, this is not ideal because the finalization thread may not execute when the programmer expects.
然而,当并发请求被发送给该页面时,所有线程将正常终止。
However, when concurrent requests are sent to this page, all threads end normally.
如清单1和清单2所示,虽然生成了可接合线程,但是却未将其联接,因此每个终止的可接合线程仍然占用进程空间,泄漏进程内存。
As demonstrated in Listing 1 and 2, joinable threads are produced, but they are never joined, so each terminated joinable thread still occupies the process space, leaking the process memory.
您还可以控制您想要终止的线程,中断的频率,甚重定义在中断以后必须为真的逻辑表达式。
You can control the thread on which you wish to stop, the frequency of suspension, and even define a Boolean expression that must be true before suspending.
在可连接状态中,另一个线程可以同步这个线程的终止,使用函数pthread_join来重新获得其终止代码。
In joinable state, another thread can synchronize on the thread's termination and recover its termination code using the function pthread_join .
Thread1是一个周期性线程(扩展WatchedPeriodicThread),运行10 个迭代后由于 “意外”异常而终止。
Thread1 is a periodic thread (extends WatchedPeriodicThread) that runs for 10 iterations and then dies because of an "unexpected" exception.
注意:bot只在启用时调用线程(记住,每个插件都是一个线程);在线程终止之后,只有在重新调用bot时才会重启线程。
NOTE: the bot invokes threads (remember that each plug-in is a thread) only when it is started; after a thread terminates it is not restarted until the bot is invoked again.
一种解决方法是增加一个变量,每创建一个新的线程该变量就加1,每终止一个线程该变量就减1,当该变量再次为零时,就关闭整个进程。
One way would be to increment a variable every time a thread is created, and decrement it whenever a thread terminates. When it reaches zero again, close the whole process.
当应用程序逻辑开始和终止时,这可以通过应用和删除线程内外的J2EE上下文信息来完成。
This is achieved by applying and removing the J2EE context information on and off the thread when the application logic begins and ends.
如果底层的线程终止了,它会被重新创建。
如果它们是可接合的线程,且您没有调用pthread_join来联接它们,那么在线程终止后,每个产生的线程都将泄漏大量的内存(至少每堆栈10MB)。
If they are joinable threads and you haven't called the pthread_join to join them, each produced thread will leak a sizeable amount of memory (at least 10mb per stack) after its termination.
即使不使用多线程处理,也要预先初始化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.
如果允许线程中的未经处理的异常正常继续,直到操作系统终止程序为止,将会在开发和测试过程中暴露此问题。
Allowing unhandled exceptions in threads to proceed naturally, until the operating system terminates the program, exposes such problems during development and testing.
当线程终止时,操作系统将清理所有分配给线程的资源,其中也包括了关闭任何线程已经打开的会话。
When a thread terminates, the operating system cleans up all resources still allocated to the thread; this includes closing any sessions which it had open.
如果线程已经启动且尚未终止,则为活动状态。
A thread is alive if it has been started and has not yet died.
本文概述了工控软件中应用多线程技术的原因,并进而论述了线程与进程的区别、线程的创建、终止、优先级及MFC类库对多线程技术的支持最后;
This paper introduces the cause of using multi-thread in industrial monitor software and how to create, terminate a thread. It also introduces how MFC supports multi-thread, etc.
线程可以因为各种各样的原因终止并进入可运行状态(因为堵塞)。
A thread might cease to runnable (that is, because blocked) for a variety of reasons.
如果子进程已经被终止则该方法立即返回,调用线程将被锁住直到子进程退出。
This method returns immediately if the subprocess has already terminated. If the subprocess has not yet terminated, the calling thread will be blocked until the subprocess exits.
该线程一直运行到它终止进入可运行状态(等待状态)或是另一个具有更高优先级的线程变成可运行状态。
This thread continues to run until it ceases to be runnable or another thread of higher priority becomes runnable.
该线程一直运行到它终止进入可运行状态(等待状态)或是另一个具有更高优先级的线程变成可运行状态。
This thread continues to run until it ceases to be runnable or another thread of higher priority becomes runnable.
应用推荐