A thread is a forked process... the whole point of running something in a
thread is usually that you what to fire and forget Ie do some batch stuff
then email the results.
OR
you want to fork to multiple threads and have them do the batch in multiple
threads (possibly shortening your batch by
Thanks Steve, I understand what you're saying, but unless I missed something,
my central question is not answered: how do I refer to a thread (from the
spawning code) using a scoped variable? The code you refer to uses unscoped
variables, which causes scope hunting.
Mischa.
Date: Thu, 26
Try one of these two...using the variables scope first
cfthread action=RUN name=variables.thread1
cfset thread.myvar = rand()
/cfthread
cfthread action=JOIN name=variables.thread1/cfthread
cfdump var=#variables.thread1.myvar#
or, try using a separate structure:
cfset myScope = StructNew() /
The first way of naming a thread fails, the second one works, but I was under
the impression that unless a variable is *prefixed* with an official scope,
like
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Variables_30.html
it is considered unscoped and CF hunts for it when
I wanted to post a short note to the list about June's ACFUG meeting topic.
This will be the same presentation I gave this year at cf.Objective().
Mainly, it's about the independence process that many of us find
ourselves wanting to explore. It's about the path from Employee to
Contractor to
That is correct, it will hunt for it. I don't remember the exact order, but it
does happen. But, that being said, if the second one worked, you now have a
scoped thread that you can reference without hunting. It used to be the
variables scope was used for all unscoped variables. Doesn't
Thanks Allen.
Regarding
But, that being said, if the second one
worked, you now have a scoped thread that you can reference without
hunting.
Do I understand correctly that
cfset
myScope = StructNew() /
cfset myScope.MyNewVar = bla
cfoutput#myScope.MyNewVar#/cfoutput
Is considered scoping
I haven't looked at that in a long time...I'm not sure how that works with
structures. My guess would be that if CF sees a dot in the dot-notation, that
it will just look for that structure, but I'm not 100% certain of that.
Allen
From: ad...@acfug.org
My understanding of what you just did will still put myscope in the
variables scope...
you can always cfdump variables and check...
I honestly wish they would get rid of the looking up the scope personality
of CF... just makes for errors and bad design.
On Thu, May 26, 2011 at 11:29 AM,