Sep 11
Jolle Carlestam Threads as suitable containers
Sep 11, 2012; 04:19
Jolle Carlestam
Threads as suitable containers
Seeing that threads are single access only how well do they deal will a high traffic site?
I'm contemplating using threads as containers of site wide information. Like settings. But I'm worried that this could become a bottleneck when traffic increases.
Calls would be like calling a map. The thread would actually be a map, having map as parent and no code running inside the thread definition. Populating it will be done by other types.
my_sitewide_setting_thread -> find('mysetting')
my_sitewide_setting_thread -> find('another_setting')
etc.
But since there would be a number of settings to lookup for each hit to the server and possibly a lot of simultaneous visitors this would be a thread object that got a lot of calls.
Today I have a settings file that's included on each call. In it I set a number of vars.
var(mysetting = 'Interesting')
var(another_setting = 'Boring')
Also means I set a lot of variables that are actually not used for that particular call. Still is very fast. Timing it indicates that including the settings file takes next to nothing.
Does the singleness of threads mean that they can only be read by one process at a time? Or is the lock only for manipulating it?
And am I better of using vars set in an include file or is it feasible to use a thread map as container?
HDB
Jolle
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso
Lasso@lists.lassosoft.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>
Sep 11
Brad Lindsay Re: Threads as suitable containers
Sep 11, 2012; 09:28
Brad Lindsay
Re: Threads as suitable containers
Sep 11
Ke Carlton Re: Threads as suitable containers
Sep 11, 2012; 15:04
Ke Carlton
Re: Threads as suitable containers