Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8775607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:50:49+00:00 2026-06-13T18:50:49+00:00

I have a django instance hosted via apache/mod_wsgi. I use pre_save and post_save signals

  • 0

I have a django instance hosted via apache/mod_wsgi. I use pre_save and post_save signals to store the values before and after save for later comparisons. For that I use global variables to store the pre_save values which can be accessed in the post_save signal handler.

My question is, if two requests A and B come together simultaneously requesting a same web service, will it be concurrent? The B should not read the global variable which is written by A and vice versa.

PS: I don’t use any threading Lock on variables.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T18:50:51+00:00Added an answer on June 13, 2026 at 6:50 pm

    This partly depends on your mod_wsgi configuration. If you configure it to use only one thread per process, then global variables are safe–although I wouldn’t recommend using them, for a variety of reasons. In a multi-thread configuration, there is nothing guaranteeing that requests won’t get mixed up if you use global variables.

    You should be able to find some more local place to stash the data you need between pre_save and post_save. I’d recommend putting some more thought into your design.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Django running in Apache via mod_wsgi. I believe Django is caching my
I have a Django based CMS that uses Django's sites framework and Nginx/Apache/mod_wsgi virtual
I have a django application using multiple databases. Given an instance of a model,
I have a django test, on an amazon ec2 instance, I see the It
I have Django 1.4 and Python 2.6.6 When I use django-amdin.py startproject djproject follow
I have a Django web app that I would like to use in a
I have a django app running on ec2. It is a micro instance, and
I have a simple Django-Piston Handler that creates a new instance of a model
I have created a Django Form Wizard which works fine. However, after finishing the
I have a django application that uses an SQLite database. I use git to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.