每个请求模型的线程能否比非阻塞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)[2023-03-17]
我不会打折嵌入Web服务器。 我之前用嵌入Jetty的Web Start应用程序完成了此操作。 下载速度非常快,服务器启动后,您可以使用BrowserLauncher立即将您的浏览器驱动到嵌入式服务器,从而驱动您的应用程序。 码头设计为模块化,占地面积小,因此您可以将其裁减为最基本的必需品。 I wouldn't discount embedding a web server. I've done this before with a web start application embedding Jett ... -
回答最初的问题(在第一段中): 我假设他们选择使用HTML来编写它,以便更轻松地使其跨平台。 To answer the initial question (in your 1st paragraph): I assume they chose to wrote it using HTML as a way to make it cross-platform more easily.
-
将Web应用程序加载为Windows桌面应用程序的简单/最佳方法?(Simple/Best way to load Web App as Windows Desktop Application?)[2022-04-04]
一个简单的VB.NET应用程序应该做的伎俩。 只需创建一个新的Windows Froms项目,双击表单,将所有内容标记为: Public Class Form1 '############## Settings ##############' 'Change to your URL Dim url As String = "http://google.de" 'Change to the text the window title should have Dim ... -
如何使用HTML / CSS / JavaScript开发桌面应用程序?(How to develop Desktop Apps using HTML/CSS/JavaScript? [closed])[2022-06-11]
您可以从Titanium开始使用桌面设备。 另外您可以看一下Chromium Embedded Framework 。 它基本上是基于铬的网络浏览器控制。 它是用C ++编写的,所以你可以在你的容器应用程序中执行所有你想要的低级操作系统(咆哮,托盘图标,本地文件访问,COM端口等),然后在html / javascript中使用所有的应用程序逻辑和gui。 它允许您拦截任何http请求,以服务本地资源或执行一些自定义操作。 例如,对http://localapp.com/SetTrayIconState?s ... -
可以按照说明自行承载ASP.NET 5 / MVC 6应用程序 。 也许您可以通过某种安装过程添加快捷方式,以便通过双击运行您的应用程序。 这是一个关于自托管MVC 5与某种黑客攻击的答案。 上述两种解决方案都不需要IIS。 但是,运行桌面应用程序的最佳选择是使用WPF来构建它。 Web的无状态特性使得处理比有状态桌面应用程序更加困难。 无论您选择哪种UI选项,重要的是将业务逻辑与UI分离,以便您可以稍后切换UI而无需太多精力。 It is possible to self-host an ASP.NET ...
-
你可能真的想看看微软的Windows Presentation Foundation。 网络的工作方式需要很多工作,并将其应用于桌面应用程序开发。 这不完全是HTML / CSS / PHP / JS,但它也不远。 它有一点学习曲线,但标记是基于XML的,所以它主要是学习它的怪癖,当然还有.Net语言和框架(尽管理论上你可以在PHP上使用PHP。网络框架)。 您可能也对Appcelerator Titanium感兴趣,它允许您使用HTML / CSS / JS来构建桌面应用程序。 我不知道桌面开发是什么样的 ...
-
我不鼓励将PHP用作桌面应用程序。 你应该分开2个appliaction。 使用PHP的Web应用程序 使用Java的桌面应用程序(或任何你想要的) 在您的桌面应用程序中,您应该提供一个“日志记录”系统,可以保存用户脱机的所有操作,并在用户上线(或用户需要时)上传到PHP应用程序,以便您可以在数据库中执行这些操作。 I discourage to use PHP as desktop application. You should sepearte the 2 appliaction. Web app us ...
-
用HTML / CSS GUI在Ubuntu上开发原生应用程序?(Develop Native Application on Ubuntu with HTML/CSS GUI?)[2022-02-19]
2011年8月,Ask Ubuntu问到了这个问题。 总之,选项是: SEEDKIT GNOME的JavaScript绑定。 有更多的选择,但这是两个“大牌”。 This was asked on Ask Ubuntu back in August of 2011. In summary, the options are: SeedKit The JavaScript bindings for GNOME. There are more options, but those are the two "big ... -
问题确实太开放了,但这是我的两分钱。 当我从ASP.NET Web Forms和MVC开发Web到WinForms开发时,我将与您分享我的经验。 如果您对Web开发有经验,那么使用.NET进入桌面应用程序开发并不是很困难。 由于共享框架,转换非常顺利。 随着您的进步,您将遇到许多与ASP.NET Web窗体的相似之处(尽管大多数只是在表面层面)。 毕竟,这正是微软当时要实现的目标 - 使Web开发更像桌面,并以一种开发人员不必过多思考的方式抽象无状态HTTP客户端 - 服务器通信的细节。它。 这是ASP.N ...
-
如何使Web应用程序看起来像桌面应用程序?(How to make web applications look exactly like desktop applications? [closed])[2022-12-02]
你可以使用ExtJs作为前端,php作为后端.ExtJs是一个用于web应用程序的javascript框架。 http://www.sencha.com/products/extjs/ you can use ExtJs for your front end and php as back-end.ExtJs is a javascript framework for web-application. http://www.sencha.com/products/extjs/