Does CGI need mutex ?

Delaney, Timothy tdelaney at avaya.com
Thu Nov 16 17:35:58 EST 2000


I respectfully have to disagree here.

Any time multiple requests can possibly access shared resources at the same
time, there is a need for some sort of synchronisation.

The original poster would probably not be asking the question if they were
not using shared resources.

I read the original question more as "Is there a guarantee that only one CGI
process will be running at the same time, or do I need to synchronise access
to shared resources?"

The answer is that there is no guarantee that there is only one CGI process
running at the same time. You must synchronise access to shared resources.
How you do that will of course depend on the circumstances specific to your
configuration. If they are (for example) all completely separate processes
(traditional CGI) you will need to use OS-based synchronisation methods
(possibly based on the file system, or other services available).

Tim Delaney
Avaya Australia
+61 2 9532 9079

> -----Original Message-----
> From: Andreas Jung [mailto:ajung at sz-sb.de]
> Sent: Friday, 17 November 2000 1:23 AM
> To: andyheath2 at lineone.net
> Cc: python-list at python.org
> Subject: Re: Does CGI need mutex ?
> 
> 
> On Thu, Nov 16, 2000 at 08:08:51AM +0000, 
> andyheath2 at lineone.net wrote:
> > Running apache on linux.
> > 
> > Anyone know - am I guaranteed instances
> > of a particular cgi script execute
> > atomically ?  Even if they block
> > for some reason ?
> 
> Every CGI request (independant of using Python) runs
> in its own process. So there is usually no dependancy between
> the instances.
> 
> Andreas 
> 
> -- 
> http://www.python.org/mailman/listinfo/python-list
> 




More information about the Python-list mailing list