ColdFusion 8 has allowed ColdFusion programmers to embrace the concept of multi/parallel-threading for the first time.
Previously, you just about do it by <cfloop>ing over CFHTTP calls to your server so that you could create multiple page requests with one thread each.
This is the first time, however, that request of a single page can fire off multiple threads within it's own scope.
I was carrying out some data migration and knew that the only way to be able carry out the migration scripting multiple times a day was to use threading. Doing it without threading was possible, but the process would have to run overnight and that ain't no good for debugging.
There was also the problem of wanted to make sure that I (as a programmer) had control of the number of threads that could be active in one go and also the number of database records that would be processed in each thread.
So, I came up with this multi threading demo. I actually used a slightly modified version of the code to do the previously mentioned migration. Any ideas on doing it better? I can't stand to use Evaluate, so that would be my first shout for help!
To view and download the code, please visit my Scribd page for the Multi-Thread Demo.
No comments:
Post a Comment