Ok, as promised, a new thread on threading...

Perhaps I should begin my question with my perhaps-incorrect
understanding of instances. I have always understood an "instance" to
be a unique, individual memory-resident copy of an object that
contains methods and properties, or functions and attributes, or
whatever they be called in your current universe. An "instance" of an
"object" would, then, be the result of a call to the object's codebase
from within an existing thread, and it's constructor would fire as
soon as the CFOBJECT or createObject executed.

I've always assumed that an instance would be intrinsically
thread-safe if the underlying engine was also thread-safe. As an
object created within a thread, wouldn't it be thread-safe because the
thread that created it "owns" that instance? And, in that case, it's
THIS scope would be available to all methods within the instance, and
whatever non-scoped var you create within a method would be
function-local by default?

Or, perhaps, we're discussing persistent CFCs, in which case I would
have assumed that if you use locks around your code that
accesses/modifies the data in your persistent CFC it would mitigate
the lack of thread-safety that ANY shared-scope variable.

Until now, I've been using this THIS scope A LOT, not VARing any of my
method variables, and wrapping CFLOCKS around calls to methods that
would alter the data within a session-scope persistent CFC. Have I
been doing this wrong? It took me 6 months to get my head around USING
CFCs (Easy concept! Murderous implementation!) to begin with, and I
still miss the good-old-days of procedural templates... so simple, so
straigforward, so... 2-dimensional. But, teach thou me and I shall
implement!

So, now that I've laid my ignorance out for you all to see, please be gentle? :D

Laterz all!

Regardz,
J

-- 
Continuum Media Group LLC
Burnsville, MN 55337
http://www.web-relevant.com

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynamics.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188770
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to