Learning ColdFusion 8: CFThread Part I - Data Exchange

<!---
	Set a name in the parent page. I am using the VARIABLES
	scope here just to drive home the fact that this is
	part of the currently-processing page request.
--->
<cfset VARIABLES.strName = "Christina Cox" />
 
 
<!--- Launch a new thread. --->
<cfthread
	action="run"
	name="mythread"
	priority="normal">
 
	<!---
		Store the value of the name in the parent scope into
		this thread's publically accessible thread scope.
	--->
	<cfset THREAD.Value = strName />
 
</cfthread>
 
 
<!--- Join the thread to the current page process. --->
<cfthread
	action="join"
	name="mythread"
	/>
 
 
<!---
	Now that all of our threads are joined together,
	we can access the name stored in the thread.
--->
#mythread.Value#

For Cut-and-Paste