Learning ColdFusion 8: CFThread Part I - Data Exchange

<!--- Define an actress object. --->
<cfset objActress = {
	Name = "Christina Cox",
	Movie = "Better Than Chocolate"
	} />
 
 
<!---
	Launch a new thread and pass in the name of an actress
	object as part of the CFThread tag definition.
--->
<cfthread
	action="run"
	name="mythread"
	priority="normal"
 
	<!--- Pass in data attributes. --->
	actress="#objActress#">
 
	<!---
		Change the value of the movie of the passed-
		in actress object.
	--->
	<cfset ATTRIBUTES.Actress.Movie = "Chronicles of Riddick" />
 
</cfthread>
 
 
<!--- Join the thread to the current page process. --->
<cfthread
	action="join"
	name="mythread"
	/>
 
 
<!---
	Now that all of our threads are joined together,
	let's output the movie value of our actress to
	see if the child thread acted on it.
--->
#objActress.Movie#

For Cut-and-Paste