每个请求模型的线程能否比非阻塞I / O更快?(Can the thread per request model be faster than non-blocking I/O?)
我记得在2,3年前阅读过一些文章,人们称现代线程库变得如此优秀,以致每个请求线程的服务器不仅比非阻塞服务器更容易编写,而且它们也会更快。 我相信甚至在Java中使用将Java线程映射到pthread的JVM(即Java nio开销超过了上下文切换开销)证明了这一点。
但是现在我看到所有的“尖端”服务器都使用异步库(Java nio,epoll,甚至node.js)。 这是否意味着异步赢了?
I remember 2 or 3 years ago reading a couple articles where people claimed that modern threading libraries were getting so good that thread-per-request servers would not only be easier to write than non-blocking servers but that they'd be faster, too. I believe this was even demonstrated in Java with a JVM that mapped Java threads to pthreads (i.e. the Java nio overhead was more than the context-switching overhead).
But now I see all the "cutting edge" servers use asynchronous libraries (Java nio, epoll, even node.js). Does this mean that async won?
原文:https://stackoverflow.com/questions/4929660
满意答案
我不会打折嵌入Web服务器。 我之前用嵌入Jetty的Web Start应用程序完成了此操作。
下载速度非常快,服务器启动后,您可以使用BrowserLauncher立即将您的浏览器驱动到嵌入式服务器,从而驱动您的应用程序。 码头设计为模块化,占地面积小,因此您可以将其裁减为最基本的必需品。
I wouldn't discount embedding a web server. I've done this before with a web start application embedding Jetty.
The download was pretty fast, the server starts up and you can use BrowserLauncher to immediately drive your browser to the embedded server, and hence your application. Jetty is designed to be modular and have a small footprint, so you can probably cut it down to the bare necessities.
相关问答
更多使用HTML开发桌面应用程序视图,作为Web应用程序(Develop desktop applications view with HTML, as a web application)
桌面应用程序中的HTML / CSS / JS(HTML/CSS/JS in desktop applications)
将Web应用程序加载为Windows桌面应用程序的简单/最佳方法?(Simple/Best way to load Web App as Windows Desktop Application?)
如何使用HTML / CSS / JavaScript开发桌面应用程序?(How to develop Desktop Apps using HTML/CSS/JavaScript? [closed])
将ASP MVC Web应用程序作为桌面应用程序运行(Running ASP MVC web application as desktop application)
在离线/桌面应用程序中呈现网页内容(Rendering web content in offline/desktop applications)
Web应用程序转换为桌面应用程序[关闭](Web Applications Converted To Desktop Applications [closed])
用HTML / CSS GUI在Ubuntu上开发原生应用程序?(Develop Native Application on Ubuntu with HTML/CSS GUI?)
可以将相同的设计模式用于Web以及.net的桌面应用程序(Can same design patterns be used for web as well as desktop applications for .net)
如何使Web应用程序看起来像桌面应用程序?(How to make web applications look exactly like desktop applications? [closed])
相关文章
更多Hadoop的I/O
Hadoop I/O系统介绍
Cannot expose request attribute 'website' because of an existing model object of the same name 的解决方案
Hadoop1.0.4 HDFS I/O性能测试
Java中如何用I/O流读取一个Word文档的内容?
《CMMI+敏捷整合开发:更快改进性能的案例与实用技术》( Integrating CMMI and Agile Development: Case Studies and Proven Techniques for Faster Performance Improvement )扫描版[PDF]
引入thread后socket接受不了报文了
线程报错 thread
最新问答
更多获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
如何通过引用返回对象?(How is returning an object by reference possible?)
矩阵如何存储在内存中?(How are matrices stored in memory?)
每个请求的Java新会话?(Java New Session For Each Request?)
css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
xcode语法颜色编码解释?(xcode syntax color coding explained?)
在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
Copyright ©2023 peixunduo.com All Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!