即使只运行一个线程,崩溃版的速度也要快约30%:获取您已占用的锁比获取无人占用的锁要快得多。
Even when run with a single thread, the collapsed version was some 30 percent faster: it is much faster to acquire a lock that you already hold than one that nobody holds.
在libspe2中,这个操作变成同步的了,因此您可能会希望在后台运行一个线程,并发出自己的pthread调用。
In libspe2, the operation is synchronous, so if you want to run a thread in the background, you have to make your own pthread calls.
当一个线程在运行的时候,不管是上传还是下载,你可以查询进程状态并且给用户一个反馈(例如一个进度条)。
While a thread is running, either uploading or downloading, you can query it to check on its status to provide the user with feedback (e.g. a progress bar).
还有一个附加的全局运行队列,其中放的是新的线程。
There is also an additional global run queue where new threads are placed.
每种策略都需要运行一个内核线程。
然而,在这个测试运行中只运行了一个线程,所以比较分析的用处并不大。
However, only one thread is running in this test run, so it's not especially useful for comparative analysis.
一个进程可以使用多个spu上下文,但是要在每个给定的时间点上在多个SPU上运行,这个进程需要包含至少一个每个正在运行的SPU上下文所使用的线程。
A single process can work with multiple SPU contexts, but to run on more than one SPU at a given time, the process needs to contain at least one thread for each running SPU context.
这样,一个事件将生成一个事件交付线程,因此许多线程将同时运行。
In this way, one event generates a thread of event delivery and thus many threads are running simultaneously.
在运行时,对于每一个包都有对应的线程吗?
此外,解决方案是在另一个不同线程上运行每一件事情。
The solution, again, is to run everything from a different thread.
并行性是通过运行主线程为每一个任务调度执行的子线程而实现的,这样任务就会并发执行,而每一个线程是同步执行任务的。
Parallelism is introduced by running the main thread scheduling child threads for each task so that the tasks execute concurrently while each thread execute the task synchronously.
乍看起来,这段代码似乎能运行得很好,因为创建了一个新的线程来处理访问网络的操作。
At first, this seems to work fine, because it creates a new thread to handle the network operation.
一个从非空运行队列的前端分派的线程具有最高的优先级。
A thread is dispatched from the front of the nonempty run-queue with the highest priority.
要在Debug视图中挂起执行线程,选择一个运行线程,单击Debug视图工具栏中的Suspend。
To suspend the execution of threads in the Debug view, select a running thread and click suspend in the Debug view toolbar.
您会想起前面介绍过,在您调用Parallel实例上的run方法时,它创建了(n - 1)个线程来运行前面(n - 1)个CSProcess实例,然后在自己的线程中运行最后一个CSProcess实例。
As you'll recall, when you invoke the run method on an instance of Parallel, it creates (n-1) threads to run the first (n-1) CSProcess instances and runs the last CSProcess instance on its own thread.
这两个线程同时开始并且都在一个循环中运行以同时访问JLAsink。
Both threads are started at the same time and both run in a loop trying to access JLAsink simultaneously.
当使用bot时,该属性会被读取且每个自定义类作为主watchit bot的一个线程运行。
When the bot is used, this property is read and each custom class is run as a thread of the main Watchit bot.
presentationreconciler类根据每次击键更新文本的外观,而Reconciler类运行一个守护线程,不必将用户界面(UI)挂起就能解析该文档。
The PresentationReconciler class updates the text's appearance with every keystroke, and the Reconciler class runs in a daemon thread, parsing the document without holding up the user interface (UI).
在多数情况下,对于一个客户机应用程序的每个连接,Informix运行一个sqlexec线程。
In most cases, for each connection by a client application, Informix runs one sqlexec thread.
有一件事需要清楚——当你在Visual Studio中运行一个带ui线程的程序时,总是会抛出一个异常。
One thing worth knowing: When you run a program with this UI threading issue from within Visual Studio, it will always throw an exception.
一个线程能看见str引用一个String对象,在该对象中构造函数尚未运行。
One thread could see the STR reference refer to a String object in which the constructor has not run.
当一个应用程序运行时,Android系统自动的为该应用程序创建一个叫做“Main”的主线程。
When an application is launched, the system creates a thread called "main" for the application.
每个连接发射一个在Node引擎的进程中运行的事件,而不是为每个连接生成一个新的OS线程(并为其分配一些配套内存)。
Instead of spawning a new OS thread for each connection (and allocating the accompanying memory with it), each connection fires an event run within the Node engine's process.
运行keventd,创建一个新的内核线程。
在进程的上下文中会有一个或多个线程在运行。
为更好地利用CPU时间,我们可以创建一个nhrt池来处理数据,通过维护一个运行中线程的池,在运行的时候就不存在任何线程启动和停止开销了。
To make better use of CPU time, we can create a pool of NHRTs to process the data. By maintaining a pool of running threads, we have no thread startup and shutdown overhead when running.
例如,假定您正在编写一个游戏程序,并为每一个可移动对象维护了一个列表,与此同时,还运行着与游戏线程无关的可移动线程。
For example, suppose you are programming a game and for this game, you maintain a list of every drawable object and have the drawing thread running independently of the game thread.
常常出现大多数线程已经完成卸载过程,只有一个线程仍然在运行的情况。
It may so happen that all the threads have finished the unload process but one is still running.
如果多个箭头显示一个环形的锁请求模式—由于它们正在相互等候其它线程释放锁,所以线程彼此阻止运行—结果就形成了一个死锁。
If multiple arrows show a circular lock-request pattern — threads prevent each other from running because they are waiting for each other to release a lock — then you have a deadlock.
如果多个箭头显示一个环形的锁请求模式—由于它们正在相互等候其它线程释放锁,所以线程彼此阻止运行—结果就形成了一个死锁。
If multiple arrows show a circular lock-request pattern — threads prevent each other from running because they are waiting for each other to release a lock — then you have a deadlock.
应用推荐