我怎样才能叉从Windows上的Perl CGI脚本一个后台进程? [英] How can I fork a background processes from a Perl CGI script on Windows?

查看:208
本文介绍了我怎样才能叉从Windows上的Perl CGI脚本一个后台进程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些麻烦,在Windows上运行时,从一个Perl CGI脚本的过程分叉。主要的问题似乎是,叉在Windows上运行时,模拟,并没有真正似乎创建一个新进程(在当前的只是另一个线程)。这意味着,这是等待的过程Web服务器(如IIS)来完成继续等待,直到背景过程完成。

I've had some trouble forking of processes from a Perl CGI script when running on Windows. The main issue seems to be that 'fork' is emulated when running on windows, and doesn't actually seem to create a new process (just another thread in the current one). This means that web servers (like IIS) which are waiting for the process to finish continue waiting until the 'background' process finishes.

是否有从Windows下的CGI脚本分叉了一个后台进程的一种方式?更妙的是,有一个单一的功能,我可以调用,这将在一个跨平台的方式做到这一点?

Is there a way of forking off a background process from a CGI script under Windows? Even better, is there a single function I can call which will do this in a cross platform way?

(而只是为了让生活困难外,我真的想一个好办法叉形输出过程到一个文件重定向在同一时间)。

(And just to make life extra difficult, I'd really like a good way to redirect the forked processes output to a file at the same time).

推荐答案

如果你想这样做独立于平台的方式,的 PROC ::背景可能是最好的办法。

If you want to do this in a platform independent way, Proc::Background is probably the best way.

这篇关于我怎样才能叉从Windows上的Perl CGI脚本一个后台进程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆