Changes between Initial Version and Version 1 of DjangoSpecifications/Core/Threading


Ignore:
Timestamp:
Apr 4, 2008, 4:30:26 AM (17 years ago)
Author:
mrts
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DjangoSpecifications/Core/Threading

    v1 v1  
     1''Part of DjangoSpecifications''
     2
     3= Threading improvements in Django =
     4
     5According to tickets #5632, #6950 and discussions http://groups.google.com/group/django-users/browse_frm/thread/a7d42475b66530bd, http://groups.google.com/group/django-developers/browse_thread/thread/fbcfa88c997d1bb3, at least the following components of Django are not entirely thread-safe:
     6 * django.template.loader
     7 * django.db.models
     8 * django.contrib.sessions
     9
     10This specification outlines the changes that need to be implemented to solve these issues.
     11
     12A related task is to identify other components not mentioned here that have threading issues.
     13
     14== Proposal ==
     15
     16Instead of ad-hoc solutions like the one proposed in #5632, there should be a locking module that can be reused.
     17
     18Four types of locking primitives could be implemented:
     19 * Django-wide global locks
     20 * module-level locks
     21 * class-level locks
     22 * function-level locks
     23
     24I don't see any use for a Django-wide lock. Module-level lock is needed for sessions. Class-level locks seem appropriate for models.
     25Template loader could use either a function-level lock or a module-level lock.
Back to Top