Ivan Sagalaev wrote:

> As Ian has pointed you can use file system as a device for locking 
> between separate processes. This is not really something specific to Django.

Yes i know. There would be other solutions like shm, or global mutexes,
but filelocks seem to be the best of the worst. However, on a apache
with worker mpm, thread locks are definitive the best choice and allow
easy usage of Semaphores etc, too.
I think django should have a Lock class and maybe Semaphores, too, which
check which type of server the app is running and choose the best
locking method.
Django already has a RWLock class under utils/sync.py, which is simply
not working on all servers. If you use apache 1.3, or apache2.x with
mpm-prefork or the experimental threadpool, or worker with more then one
 instance, thread locks are useless. I think providing a easy to use
Locking class that works regardless the server used is something
important for a web framework.

> On Windows, if I remember correctly, you don't use fcntl but use some 
> exclusive locking options for open().

I don't use open, but python2.4 docs suggest using fp.lock() as a
platform independent function.

kindly regards
  Daniel

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to