anil maran wrote:
> hi
> i have a program that is run on a website, and as it
> is run from a website, it can be called more than once
> and hence could end up corrupting db/data
> is there a way to use some sort of semaphore or lock
> so that it is not accessed simultaneously
> the problem is it can be done with static variables in
> C but how is it done in python

If you are using a database for storage you should learn how to use the 
transactional features of the database. They are designed to let you 
control what happens when multiple users access the database at the same 
time.

To protect access to other kinds of data look at threading.Lock and RLock.

Kent

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to