Threading
From CEW
Threading allows you to split up your scripts and run different logic in parallel. When used properly, it can help improve performance.
Both BlueDragon 7 and ColdFusion 8 support threading, however there are differences in their implementations. BlueDragon uses separate tags, whilst ColdFusion uses a single tag with an action attribute.
Contents |
Creating
Spawns a new thread out of the current thread.
<cfthread action="run"/>
<cfthread>..</cfthread>
Joining
Waits for a thread to finish before joining it into the current thread and continuing.
<cfthread action="join"/>
<cfjoin/>
Sleeping
Sends a thread to sleep for a specified duration.
<cfthread action="sleep"/>
<cfpause/>
Interrupting
Interrupts a thread which is currently sleeping.
<cfinterrupt/>
Stopping
Stops a thread which is running.
<cfthread action="terminate"/>
functions
getAllThreads()
Returns an array of thread variables representing all actively running threads.
ThreadInterrupt()
Interrupts a sleeping thread and allows it to continue running. Equivalent to cfinterrupt.
ThreadIsAlive()
Returns true if the specified thread is still running.
ThreadJoin()
Waits for a thread to finish before joining it into the current thread and continuing. Equivalent to cfjoin.
ThreadRunningTime()
Returns the number of milliseconds the specified thread has been running for.
ThreadStop()
Stops a thread which is running.


