A better approach is to start a timer, and have timer poke the event thread every so often to go look at the staging area for updates.
更好的方法是启动计时器,并且使计时器不时地提醒事件线程去查看中间区域,以寻找更新。
Using asynchronous message passing and pipelining, it promises to offer more control than thread pools and better performance than manual threading.
借助于异步消息传递与管道,它可以提供比线程池更好的控制,也比手工线程方式具备更好的性能。
Since every request is handled in a separate thread, better scalability is possible.
由于将以单独的线程处理每个请求,所以可以获得更好的可扩展性。
NewScheduledThreadPool creates a pool that works like the Timer object but is better at handling uncaught exceptions and thread starvation.
newScheduledThreadPool可以创建像Timer对象一样工作的线程池,但是能够更好地处理未捕获的异常和线程饥饿。
A dictionary or a class is likely to be a better data structure for thread management. As a quick example, below is a class that can (almost) drop in for the threads list in the examples.
字典或类可能是线程管理中更好的数据结构。
Even better, in recent JVMs, the performance cost of uncontended synchronization (when no thread attempts to acquire a lock when another thread already holds it) is quite modest.
不过现在好了一点,在最近的JVM 中,没有争用的同步(一个线程拥有锁的时候,没有其他线程企图获得锁)的性能成本还是很低的。
If you have two operations that require synchronization separated by a small block of thread-safe code, you are generally better just using a single synchronized block.
要是您想用一小块线程安全代码把要求同步的两个操作隔开,那么只使用一个同步块一般会更好些。
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.
为更好地利用CPU时间,我们可以创建一个nhrt池来处理数据,通过维护一个运行中线程的池,在运行的时候就不存在任何线程启动和停止开销了。
WarChild and the Dark Huntress both asked me if it's better to collect trades or singles on the thread I set up.
战童“和”暗黑女猎手“都在我的贴子里问我合订本和单行本到底收藏哪一个更好一点。
It would be better if the right thread were on core 1, but we seem to be stuck with taking a chance that the wrong one ends up on core 1, and that's very bad, leaving cores 0 and 2 as the safe choice.
如果正确的线程位于核心1上将会更好,但是也可能会遇到错误线程正好位于核心1上的情况,这就会非常糟糕。保留核心0和2为安全选项。
The common thread in each of these lessons is to let go of the past, and create a better future.
这四条经验教训的共同点就是放手过去并创造新的未来。
This is a recipe for trouble because in some JVMs, creating a Thread is a heavyweight operation, and it's far better to reuse existing Threads than to create new ones.
这可以解决一些问题,因为在一些JVM 中,创建Thread是一项重量型的操作,重用现有 Thread比创建新线程要容易得多。
The running thread through my career has been the notion that when ordinary people get involved, get engaged, and come together in collective effort, things change for the better.
贯穿我的生涯的一条主线、就是这样的观念:如果普通大众全身心投入我们的共同努力,那么这件事就一定越来越好。
It would be better to run 7 queues instead of one, i. e. one per source thread, and read them in the order necessary.
这将更好地运行7个队列,而不是一个,即每一个源线,并在必要的阅读顺序。
Also, if there is a chance that more than one thread might delete the object, the merged approach might not always work. In this situation, it is better to maintain separate synchronization objects.
同时,如果存在超过一个线程会删除对像,这种合并的方法可能会工作异常,在这种情况下,最好是分开维护同步对像。
In this case you better use a thread pool which contains at most a specific number of threads (say for example 25).
在这种情况下你最好使用线程池最多包含一个特定的线程数量(例如说25)。
The stability of saw-toothed thread implants is better than "V" thread.
锯齿型螺纹种植体的稳定性比三角型螺纹好。
Roman R. provides some good options but there is a better alternative, IMO: you can marshal the listeners to the thread which fires the event.
罗马河提供了一些很好的选择,但有一个更好的选择,我可以引导听众对线程的火灾事件。
Conclusion Zhuang medicine medicated thread moxibustion has a better therapeutic effect on asthma of lung deficiency type, with safety.
结论:壮医药线点灸对肺虚哮喘有较好疗效,且安全方便。
Something needs to be done urgently to better protect Yao's security and privacy. Can someone get Yao's management team to look at this thread?
需要赶快采取措施保护姚的安全和隐私。谁能让姚的管理团队看到这个帖子?
Attention: Prevent contacting the allergic source Cooperating use: You'd better use it with relaxing allergy & shining face mask, fading red blood thread repair cream or anti- allergy repair cream.
注意事项:防止接触过敏源配合使用:配合舒敏焕颜面贴膜、抗敏修复霜或褪红血丝修复霜使用,镇静安抚效果更好。
Attention: Prevent contacting the allergic source Cooperating use: You'd better use it with relaxing allergy & shining face mask, fading red blood thread repair cream or anti- allergy repair cream.
注意事项:防止接触过敏源配合使用:配合舒敏焕颜面贴膜、抗敏修复霜或褪红血丝修复霜使用,镇静安抚效果更好。
应用推荐