Why doesn't mod_wsgi support daemon mode on Windows?

百般思念 提交于 2019-12-14 01:06:52

问题


On http://code.google.com/p/modwsgi/ one can read this statement

Daemon mode of mod_wsgi will however only be available on Apache 2.0 or 2.2 running on UNIX, and only when the Apache runtime library underlying Apache has been compiled with support for threading.

What's the reason there's no support for daemon mode under Windows?

I found the above after getting

Invalid command 'WSGIDaemonProcess', perhaps misspelled or defined by a module not included in the server configuration

error from Apache. It's not a problem with module's inclusion as WSGIScriptAlias directive works ok. I guess the error I get is due the limitation described on the mod_wsgi's wiki.


回答1:


Windows doesn't provide UNIX style fork() system call and so process spawning where child process inherits parent process memory image isn't possible. Apache/mod_wsgi requires fork().




回答2:


For all who, after reading Graham's answer, want to know more on fork() on Windows here are questions related to this subject:

What is the closest thing windows has to fork()?
substitute for fork()ing? in windows.
CreateThread vs fork()
fork/chroot equivalent for Windows server application
Where does Microsoft Windows 7 POSIX implementation currently stands?

The two interesting things mentioned in the threads above are:

  • Interix - an optional, full-featured POSIX and Unix environment subsystem for Microsoft's Windows NT-based operating systems.

  • Cygwin's fork implementation

In addition I asked Does Interix implement fork()?



来源:https://stackoverflow.com/questions/5364949/why-doesnt-mod-wsgi-support-daemon-mode-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!