dazuiniu's blog

cat /dev/dazuiniu/random

Archive for the ‘event’ tag

基于事件和基于线程的编程模型

View Comments

如果不需要考虑多个连接的问题,而且一个连接所做的处理是计算密集型,那么每一个连接对应一个线程是最好的方式。但是如果有许多连接,并且每个连接的时候很短,而且都是非阻塞的处理,那么基于事件方式的处理就会具有更好的扩展性。

[1]. Threads with Events

Written by dazuiniu

June 22nd, 2010 at 8:03 pm

Posted in all about dev

Tagged with , ,