> It is quite plain that simple variables are not thread-safe
> in CF. Does anyone know whether CF structures are thread-safe
> or not? The MFC have thread-safe collection classes, but I
> don't know if Allaire 'rolled their own' for Cold Fusion.
As far as I can tell, any native CF data object (simple values, queries,
structures, arrays) are not thread-safe when placed in a shared memory
scope.
> It seems to me that locking could much better be managed by CF using
> thread-safe Variant objects that provide inherent locking and
> reference counting than by the current system...
Perhaps it could be, but there might be significant overhead if you handle
locking on a per-object basis. I'll give you an example. Let's say you're
retrieving two variables from shared memory:
<CFSET localvar1 = Session.var1>
<CFSET localvar2 = Session.var2>
If the variables themselves handled their own locking (if, for instance, you
instruct the CF server to lock reads automatically in the CF Administrator),
you'd end up with the equivalent of this:
<CFLOCK SCOPE="SESSION" ...>
<CFSET localvar1 = Session.var1>
</CFLOCK>
<CFLOCK SCOPE="SESSION" ...>
<CFSET localvar2 = Session.var2>
</CFLOCK>
Now, that can be done more efficiently by handling the locking yourself,
with one set of CFLOCK tags.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.