I was browsing the mod_wsgi.c source code to gain some understanding of the 
thread and process model. While looking around, I noticed that there are 
several uses of "volatile" variables. The corresponding variables appear to 
be accessed across threads.

I suspect the uses of volatile here are incorrect. Volatile in C does not 
offer any guarantee of atomicity, and is instead intended for memory-mapped 
reads typically found in embedded code. For example, I see 
"--wsgi_request_count" at line 11004 of mod_wsgi.c (version 3.4) has no 
mutex around it. There are other uses of "volatile" variables that are 
mutex-guarded, but at that point, why use "volatile"?

I may have this wrong, but I thought I'd ask in case.

Thanks for the great work on mod_wsgi,
Keir

p.s. the APR has atomic integer operations:
http://apr.apache.org/docs/apr/0.9/group__apr__atomic.html

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to