使用 Apache/FastCGI 生成多个 C 可执行进程
我没有成功地找到有关此问题的帮助。我想做的是:我有一些基于 C 的可执行文件来实现服务器端逻辑。每个客户端应该有一个进程运行此可执行文件。该进程应在客户端发出第一个 HTTP 请求时调用,并在稍后收到特定 HTTP 请求时终止。
那么问题来了。如何根据 HTTP 请求内部结构从 FCGI 程序启动一个新进程,在该进程中运行我的 C 可执行文件,然后从同一个 FCGI 程序终止该进程?实际上,服务 C 应用程序进程在后台运行。
I've not been successful in finding help with this issue. What I want to do is following: I have some C-based executables that implement the server side logic. There should be one process running this executable per client. The process should be invoked upon the first HTTP request form the client and killed once a specific HTTP request comes in later on.
So here's the question. How can I start a new process from a FCGI program based on HTTP request internals, run my C-executable in that process and later kill the process from the same FCGI program? Effectively the serving C application processes then run in the background.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您从 fastcgi.com 下载 devkit,它包含一个线程服务器的示例,该服务器使用 libfcgi 函数来分离工作线程中的标头。
应该为您管理可执行实例提供一个良好的起点。
if you download the devkit from fastcgi.com it contains an example for threaded server that uses the libfcgi functions to pick apart the headers in the worker threads.
should give you a good starting point for managing your executable instance(s).