As I understand it the Value and Array classes rely on being able to create it 
in a process from which child processes that need it are then forked. There is 
no point in Apache parent process where you could create the object so that it 
is shared across either Apache child worker processes, or mod_wsgi daemon 
processes.

Graham

> On 23 Feb 2018, at 9:55 am, Devesh Aggrawal <[email protected]> 
> wrote:
> 
> So, If I want some shared data that is accessible to all the apache processes 
> and threads, can I use Value of multiprocessing to store those variables and 
> acquire and release locks on them accordingly? 
> 
> On Monday, May 2, 2011 at 7:07:02 PM UTC+5:30, Ed Summers wrote:
> Hi all, 
> 
> I asked this over on web-sig [1] earlier today, but am asking here 
> since it looks to only mod_wsgi related... 
> 
> I've been trying to use the multiprocessing [2] w/ mod_wsgi and have 
> noticed what appears to be deadlocking behavior with body django and 
> web.py.  I created a minimal example with web.py to demonstrate [3]. 
> 
> If you have mod_wsgi and web.py available, and and put something like 
> this in your apache config: 
> 
>     WSGIScriptAlias /multiprocessing /home/ed/wsgi_multiprocessing.py 
>     AddType text/html .py 
> 
> then visit: 
> 
>     http://localhost/ <http://localhost/> 
> 
> and compare with: 
> 
>     http://localhost/?multiprocessing=1 <http://localhost/?multiprocessing=1> 
> 
> you should see the second URL hang. 
> 
> Going forward I'm most likely going to move this functionality to an 
> asynchronous queue (celery, etc) but I was wondering if 
> multiprocessing + mod_wsgi was generally known to be something to 
> avoid, or if it was even forbidden somehow. 
> 
> Any assistance you can provide would be welcome. 
> 
> //Ed 
> 
> 
> [1] http://mail.python.org/pipermail/web-sig/2011-May/005065.html 
> <http://mail.python.org/pipermail/web-sig/2011-May/005065.html> 
> [2] http://docs.python.org/library/multiprocessing.html 
> <http://docs.python.org/library/multiprocessing.html> 
> [3] https://gist.github.com/951570 <https://gist.github.com/951570>
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "modwsgi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at https://groups.google.com/group/modwsgi 
> <https://groups.google.com/group/modwsgi>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to