I think this is more about naming the thread itself than passing values into
it. Let's say I'm not interested in passing values in, or even the outcome of a
thread, only how much time it took:
<cfthread action="RUN" name="thread1">
<!--- long running action with no output here --->
</cfthread>
<cfthread action="JOIN" name="thread1"></cfthread>
<cfoutput>This took #thread1.ElapsedTime# ms.</cfoutput>
How would I code the above and have CF *not* hunt for the scope that thread1
is defined in?
From: [email protected]
To: [email protected]
Date: Wed, 25 May 2011 16:19:23 -0500
Subject: RE: [ACFUG Discuss] CFThread name issue
I’m thinking that when you send something to thread, you have divorced it from
the request scope entirely, hence, your inability to reference it as a request
scope variable even with a syntactically correct var name. Based on what you’re
posting, I’d say scoping it into variables would solve the problem, yes? Or am
I misunderstanding what you’re saying completely? J
Troy Jones
___________________________________________________________________________________________
Troy Jones | Director of Technical Services | Dynapp Inc | 1-800-830-5192
ext. 603 | dynapp.com | facebook.com/dynapp
From: [email protected] [mailto:[email protected]] On Behalf Of Mischa Uppelschoten
Sent: Wednesday, May 25, 2011 4:13 PM
To: [email protected]
Subject: RE: [ACFUG Discuss] CFThread name issue
That's another way of phrasing my question :-) Stuffing them into a struct
works, so it's not some sort of issue w/ dot notation
<cfthread action="RUN" name="MyStruct.thread1"> works.
From: [email protected]
To: [email protected]
Date: Wed, 25 May 2011 15:00:08 -0500
Subject: RE: [ACFUG Discuss] CFThread name issue
Can threads be referenced with the request scope?
Troy Jones
Error! Filename not specified.
___________________________________________________________________________________________
Troy Jones | Director of Technical Services | Dynapp Inc | 1-800-830-5192
ext. 603 | dynapp.com | facebook.com/dynapp
From: [email protected] [mailto:[email protected]] On Behalf Of Mischa Uppelschoten
Sent: Wednesday, May 25, 2011 3:30 PM
To: [email protected]
Subject: [ACFUG Discuss] CFThread name issue
Running into a headscratcher with cfthread. CF 8 Ent, Win 2k3
This works:
<cfthread action="RUN" name="thread1">
<cfset thread.myvar = rand()>
</cfthread>
<cfthread action="JOIN" name="thread1"></cfthread>
<cfdump var="#thread1.myvar#">
this throws an error "Element THREAD1.MYVAR is undefined in REQUEST":
<cfthread action="RUN" name="request.thread1">
<cfset thread.myvar = rand()>
</cfthread>
<cfthread action="JOIN" name="request.thread1"></cfthread>
<cfdump var="#request.thread1.myvar#">
What gives? How do I prevent scope hunting when referencing the result of my
threads?
Thanks!
Mischa.
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1375 / Virus Database: 1509/3659 - Release Date: 05/25/11
-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform
For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by FusionLink
-------------------------------------------------------------
-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform
For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by FusionLink
-------------------------------------------------------------
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1375 / Virus Database: 1509/3659 - Release Date: 05/25/11
-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform
For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by FusionLink
-------------------------------------------------------------
-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform
For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by FusionLink
-------------------------------------------------------------
-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform
For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------