Migration Solutions for ColdFusion Applications to ASP.NET
      
Vince Bonfanti's Weblog

Multi-threaded programming in BlueDragon 7.0 (CFTHREAD/CFJOIN)

I can't keep quiet about this stuff--it's just too good. One of the coolest new features of BlueDragon 7.0 is the ability to do multi-threaded programming. The basic idea is very simple: any CFML code wrapped in the new CFTHREAD tag is rendered on a separate thread while the main (request) thread continues processing concurrently. The main (request) thread can wait for the CFTHREAD by using the new CFJOIN tag. Here's what it looks like:

  <cfthread name="myThread">
      <!--- myThread has a new Variables scope, like a custom tag, and
            can access the Application scope and tag Attributes --->
      <cfset variables.greeting="Hello, World">
      
      <!--- ...do some more work here... --->
  </cfthread>
 
  <!--- myThread is initially an empty struct --->
  <cfdump var="#myThread#">

<!--- ...do some more work here... --->

<!--- wait for myThread to finish ---> <cfjoin thread="myThread"> <!--- myThread now contains the Variables scope of the CFTHREAD body ---> <cfoutput>#myThread.greeting#</cfoutput>

"So what is this possibly good for?", you might ask. Or maybe you already know. In either case, be sure to come to my CFUNITED keynote presentation on Friday, June 30 at 11:00 am where I'll talk about this and other new BlueDragon 7.0 features in detail. See you there!

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Vince, are you guys gonna make these tags available in JX?

Or will I just have to wait till next week?
# Posted By Andy Allan | 6/23/2006 9:31 AM
Hi Andy,

Yes, all new BD 7.0 features will be available in JX, and there will be no feature limitations in JX versus BD/J2EE. For example, CFDOCUMENT in JX will be multi-threaded, not limited to a single thread as it is in CFMX Standard.
# Posted By Vince Bonfanti | 6/23/2006 9:43 AM
You do realise you're pretty much making CFMX Standard obsolete. Oh. ;)
# Posted By Andy Allan | 6/23/2006 10:49 AM
Will be a limitation on this? I believe so. Imagine a loop over a cfthread tag. The limitation will be per request? Nice feature!
# Posted By Alex Hubner | 6/23/2006 11:06 AM
* Stands up, tips hat, and begins clapping... then remembers he's a geek and lets out a loud 'WOOT'
# Posted By Matthew Reinbold | 6/23/2006 11:38 AM
Hi Alex,

Yes, there will be a limit on the number of threads that can be created using CFTHREAD. We're still discussing different ways to implement this.
# Posted By Vince Bonfanti | 6/23/2006 12:02 PM
OH MY GOD!!!!!!!!!

This is awesome. I can finally now CFHTTP to two sites without waiting for the first to finish. That's it, I'm switching to BD.NET. I need to know what the pricing is going to be for this puppy.
# Posted By Tony Petruzzi | 6/26/2006 8:15 AM
Hi Tony,

Glad you like it (it's my favorite new feature in BD 7.0). Pricing for BD.NET 7.0 will be the same as it is currently: $2999/CPU. Volume discounts are available; for more info contact sales@newatlanta.com.
# Posted By Vince Bonfanti | 6/26/2006 10:13 AM
Hello Vince, we are interested in Bluedragon server jx for our website, is there any difference in the email sending performance of Bluedragon server JX vs Bluedragon .net or j2ee versions.

Thank you and Best regards

Luis Rueda
# Posted By Luis Rueda | 7/18/2006 3:10 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.9.2.001. Contact Blog Owner

company media information terms of use privacy policy contact us
This page was dynamically built on the BlueDragon CFML Engine