I have a nice little threading problem with a library I use to generate and serve dynamic graphs and charts in Zope. See this question for a description of my original problem.
As the website is already in production, I don't have time to debug that library (I'm not an expert in either C nor threading), hence I'm looking for the quick fix. The best idea I could come up with is to use mod_wsgi as some kind of a guard:
WSGIScriptAlias /graphs /path/to/my/app.wsgi
WSGIDaemonProcess mysite user=www-data group=www-data processes=1 threads=1
The wsgi app at /path/to/my/app.wsgi
would simply redirect every request to /_graphs
which is again handled by Zope. Because I restrict the wsgi app to one process with one thread, it should prevent any threading problems. The website isn't high volume, I don't really care if this costs me some performance. Also, I don't care that the /_graphs
URL isn't protected from direct access, the original problem only appears if charts are downloaded concurrently, which only happens when the user views a page with several embedded dynamic charts.
Nevertheless, this "solution" (if it even works) makes the little computer scientist in my head cry like a baby. Any better ideas?