当一个线程在运行的时候,不管是上传还是下载,你可以查询进程状态并且给用户一个反馈(例如一个进度条)。
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).
每个客户机请求需要一个线程。
异步请求是在另一个线程上处理的。
一个线程被分配为处理关机事件。
注意它已经包括了一个线程ID。
一个线程可以派生另一个进程。
请求被工作进程中的一个线程获取。
The request is picked up by a thread within the worker process.
每个消息流就是一个线程。
而对于异步用例,我们只使用一个线程。
一个线程被创建来处理每个新用户连接。
因此必须确定生成一个线程来获取数据。
一个线程会检查数据区,检查数据的到达。
A thread polls the data area and checks for the data's arrival.
同步语句一次仅允许一个线程进入代码块。
The synchronized statement enbales only one thread to enter a code block at a time.
可取的方法是为每个邮箱目录指定一个线程。
The best practice approach is to assign one thread per mail directory.
使用单独一个线程池可能会导致严重的锁争用。
Having a single thread pool could cause significant lock contention.
如果锁刚好只被一个线程访问,则可以使用偏向锁。
If the lock happens to be accessed by only one thread, biased locking can be applied.
结果,每一个线程都会等待另一个线程所保持的锁。
As a result, each thread ends up waiting for a lock held by the other thread.
因此实现典型的每个连接一个线程的模型便非常简单。
Thus it is relatively straightforward to implement the classic one thread per connection model.
这阻塞了主线程但是在另一个线程上执行代码。
This blocks the main thread but executes the code on another thread.
如果暂挂一个线程,则其堆栈帧显示为子元素。
If the thread is suspended, its stack frames are shown as child elements.
而另一个线程可随处运行,这会导致性能降低。
The other just goes wherever it wants, and that leads to poorer performance.
然而,该测试程序只包含一个线程,因而显然不存在竞争。
However, the test program contains only a single thread, and therefore is guaranteed never to experience contention.
MyObservable启动一个线程,读取系统时钟。
所有基准测试都只使用一个线程;同步的类不涉及线程争用。
Only a single thread is used for all these benchmarks; the synchronized classes are under no thread contention.
这样将给您带来50个文件,每个文件仅包含一个线程的跟踪数据。
This leaves you with 50 files, each containing the trace for just one thread.
请求/响应周期使它成为了经典的模型,即每个连接使用一个线程。
The request/response cycle lends itself to the classic one thread per connection model.
当一个线程向另一个线程请求信息时,就可能引起线程切换。
One thread asking another for information can cause a thread switch, or one thread preempting another can cause a thread switch.
一个线程可以同时持有多个锁,并且可能已经按某种顺序获得了这些锁。
A thread can simultaneously hold more than one lock, and these locks might have been acquired in a certain order.
一个线程称为setter方法,另一个线程称为retrieval方法。
One thread calls the setter method and the other thread calls the retrieval method.
当一个线程中断另一个线程时,被中断的线程不一定要立即停止正在做的事情。
When one thread interrupts another, the interrupted thread does not necessarily stop what it is doing immediately.
应用推荐