On Apr 28, 5:44 pm, Jarek Zgoda <[EMAIL PROTECTED]> wrote:
> Christian Vest Hansen napisał(a):
>
> > On 4/28/08, rich <[EMAIL PROTECTED]> wrote:
> >>  Yes, I too am at a similar level of confusion as to when django is not
> >>  thread safe.
>
> > With the python GIL, is it even possible to create a python program
> > that isn't thread-safe? I thought that was the whole point of having a
> > GIL in the first place; make concurrency a non-issue.
>
> Yes, it is still possible. Create an object with global state, alter it
> from different threads without locking and there you go, the state of
> object is not consistent (threads can not rely on the state), you might
> even get race condition. GIL protects only internal state of VM, not
> your objects' state.

Correct. For some background on when multithreading issues apply with
mod_wsgi, see:

  http://code.google.com/p/modwsgi/wiki/ProcessesAndThreading

In particular, for any configuration where wsgi.multithread is True,
you need to know your code is thread safe.

The document includes a brief summary at the end about building
portable applications that can deal with both multithread and
multiprocess web servers.

Graham
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to