管理客户端进程分配的资源
作为实验的一部分,我想为应用程序编写一个基于 OpenGL 的 UI 服务器,类似于架构上的 X11 或 Quartz:核心进程将对象渲染到单个视口中,但所有图形对象都由远程进程控制。
这个想法是视图的稳定性仅依赖于核心进程。 如果客户端进程出现段错误,其分配的资源将被安全地释放 - 该功能的要求是能够安全地查明客户端进程是否已崩溃。
这里的最佳实践是什么?
As part of an experiment, I want to write a OpenGL-based UI server for applications, similar to X11 or Quartz in architecture: a core process renders objects into a single viewport, but all graphical objects are being controlled by remote processes.
The idea is that the views stability is only dependent on the core process. If a client process segfaults, its allocated resources would be safely freed - a requirement for that feature is being able to securely find out whether a client process has crashed.
What is the best practice here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这应该被检测为客户端连接上的事件,就像任何其他客户端/服务器体系结构一样。
如果您使用套接字,套接字最终会注册一侧已关闭套接字(当进程崩溃时,套接字的一端将被关闭),您可以检测到这一点,在服务器的记录中查找拥有客户端,然后清理所有资源。
服务器直接(通过进程 ID 或其他方式)查找客户端会很奇怪,而且这也会不必要地限制您的架构只能在本地运行,而不是通过网络运行。
I think this should be detected as an event on the connection to the client, just as with any other client/server architecture.
If you use sockets, the socket will eventually register that one side has closed the socket (as the process crashes, its end of the socket will be closed), and you can detect that, look up the owning client in the server's records, and clean out all resources.
It would be very weird for the server to directly (through process IDs or whatever) look for the clients, and that would also needlessly limit your architecture to only run locally, and not across a network.