On Tue, Jan 13, 2009 at 4:48 PM, Graham Dumpleton < [email protected]> wrote:
> > 2009/1/14 Joe Holloway <[email protected]>: > > > > Would it be possible (in theory) for mod_wsgi to leverage the Python > > multiprocessing package to support daemon process mode on Windows, > > even if in some degraded fashion on Python 2.6 (or even 2.4/2.5 if > > backport is available)? > > > > I don't know if the work effort would ultimately be worth it, but I'm > > just curious if my naive understanding of the problems being solved > > under-the-hood are similar enough to make it viable. > > The daemon mode of mod_wsgi relies on fork in order to retain the in > memory data set up by the parent. The subprocess module as I > understand it does an exec as well and so would need to be a quite > different beast if one was to use that. > > What it ultimately comes done to is that I don't use Windows myself > and have very little interest in the platform. That embedded mode of > mod_wsgi even works on Windows is probably more luck than anything > else, aided by fact that the Apache Runtime Library provides a good > cross platform set of common functions so don't in the main have to > worry about Windows specifics. Thus, don't expect me to develop > anything which is Windows specific and if I have available better ways > of doing something for UNIX systems which doesn't work on Windows, you > just will not see an equivalent on Windows. > > Graham That's fair. We are pushing for our organization to migrate our WAMP to LAMP, so we can stick with our current solution for the time-being. I just wanted to understand the conceptual overlap with the multiprocessing package a little better since it seems like it tries to solve IPC in a platform-neutral way (at least in the API design, perhaps the Windows implementation will always be naive and slow). So, the answer is that mod_wsgi uses a shared memory model for IPC via process forking which isn't supported on Windows. The IPC mechanism of mod_wsgi would have to reworked or generalized in some fashion to allow for a different style of message-passing to child processes on Windows. I guess it would be an interesting experiment to develop an Apache module which hands daemon mode off to the multiprocessing package, but perhaps not very practical. Thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en -~----------~----~----~----~------~----~------~--~---
