Apache Mod-Python - Re: [mod_python] Sessions performance and some numbers

This is Interesting: Free IT Magazines  
Home > Archive > Apache Mod-Python > April 2005 > Re: [mod_python] Sessions performance and some numbers





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: [mod_python] Sessions performance and some numbers
Barry Pearce

2005-04-08, 5:45 pm

Hi,

> what's a .lck file? locking by definition *must* be an OS capability or
> else it _is_ subject to race conditions.


errr. no. here is the code snippet:

persist = os.open(self.m_file, os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0660)

O_CREAT | O_EXCL ensures that any race is coped with by the operating
system kernel - works equally well on mac/win32/unix/linux if two
threads try it at precisely the same time one will win one will fail -
the failed one simply re-evaluates the random and tries again. As yet
though I have yet to see a collision on my code...I could only test by
manufacturing the situation.

> Current locking uses the APR's global locking mechanism which decides
> based on OS and the httpd config/compile options what the most efficient
> locking mechanism is. There is no reason to reinvent the wheel here -
> it's a complex problem that I trust the APR folks are most qualified to
> solve.


Fair do. But its not complex - given that part of the day job is linux
kernel development - locking is not that bad!!!

Regards,
Barry

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com