Off list:
Alan,
Here is my pseudo-code to achieve this.
Begin the critical code section with
if (user$active>0)
return a page saying, "sorry, you have a request pending, try again"
else
user$active=user$active+1
if (user$active=1)
**** Critical Code ****
else abort this transaction. endif user$active=user$active-1 return
On Thursday, January 6, 2005, at 01:58 PM, Alan Wolfe wrote:
i might be totaly wrong but i thought i heard once that there was some way
to set up "critical sections" in witango so that you could make threadsafe
code.
anyone remember that at all or did i dream it up hehe?
----- Original Message ----- From: "John McGowan" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Thursday, January 06, 2005 9:20 AM Subject: Witango-Talk: Preloading the Witango Cache
I have a problem...
After a witangod restart or purge of the witango cache, requests are
coming in from the outside to files on the witango driven sites. Every
hit to the site is through a content management system that consists of
1 TAF and a couple of large TCF files. Without caching, these sites
wouldn't run well at all, because witango takes too long to load the
xml, parse it and execute it. However, once the first hit comes in, and
the taf and tcf files are cached, everything runs lickety split. But,
since there are multiple hits coming, in, there is the potential that
there are several threads all trying to populate the cache with a large
tcf. Then it takes a lot longer for the site's response time to be
acceptable... But if i could force the server to not be multi threaded I
wouldn't have threads competing for IO and CPU time.
I thought about setting a startup url in witango.ini to be a startup.taf
and have startup.taf execute some @url calls to prepopulate the cache on
multiple sites running on this box. problem is though that those @url
calls all fail with the "Server is starting up" message, (Same exact
problem that Bill Conlon had a while back when trying to initalize
domain variables.)
So now I'm thinking about this... perhaps i can set witango.ini's thread
pool size to 1 on server startup, and change it on the fly to a higher
value? Is that possible, will the server allow me to increase the
threads after the server has been running for a minute or so? Then the
only tricky thing to do is to have the url called that increases the
threadpool size at the right time after the server restarts. perhaps
this is a job for the at command.
Before I went and tried to mess with the threadpool size while the server is running i thought i'd check here first to see if it's even possible.
/John
______________________________________________________________________ __
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
_______________________________________________________________________ _
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
