Hi David,

Multiple wsgi processes will exist as separate OS processes meaning no
visibility of each other's variables.

If you restrict the process count to 1 and have multiple threads, then you
could keep global state in that way (cross thread), BUT standard
multithreaded progamming (locking etc...) applies or you will pay dearly
with unexplained random bugs.

Best advice I can give you after using these tools for a long time is to
just use Redis.  Redis is awesome and perfect for this kind of thing.

Thanks!
Jason
On Sep 26, 2014 1:14 PM, "David Sargrad" <[email protected]> wrote:

> I have just started using wsgi. I define two processes using
> WSGIDaemonProcess.
>
> My application is a flask application. Everything is working fairly well,
> except I do have a bug in my app that I think may be related to my
> misunderstanding of the scope of a global dictionary that I define.
>
> global workspace_spec_dict
>
>
> I place a key in that dictionary and within specific requests I look for
> that key. This fails about half the time. Upon failure I print out the
> dictionary only to find that it is empty. I am guessing that this is not
> truly global and that depending on which wsgi daemon process is handling
> the request the dictionary may be empty, or correct.
>
> Is this true? What does "global" mean in the context of a WSGI based
> application?
>
> Thanks for any insights relative to this problem I am having.
>
> --
> 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 http://groups.google.com/group/modwsgi.
> For more options, visit 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 http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to