3

I'm presenting on Concurrency in ColdFusion at CFObjective this year, and I'd like to hear how you're using CFThread in your ColdFusion applications.

In addition, what problems have you had while using it, and how (if at all) have you solved them?

What do you dislike about CFThread?

Have you run into significant weaknesses with CFThread or other problems where it simply could not do what you wanted to do?

Finally, if there's anything you'd like to add related to concurrency in CF, not specifically related to CFThread, please do tell.

2 Answers2

4

CFthread has been a handy little tool :)

  • One thing I've used cfthread for is background image resizing. If a user uploads a large image (let alone many users), it needs to be resized. Threads work well.

Observations:

As for sticky areas, one area that's sticky / unclear for starting out with threading is how to best pass information in and out of a cfthread call. One of the things that a cfthread generally needs is to be completely self contained -- so you have to pass in the information it needs when you make the cfthread call.

Knowing how to do joins (if required) vs, when you can pass in the information so the thread can spawn and complete entirely on it's own is helpful.

0.05 :)

4

I've used cfthread alot with batch processing - and more around memory management than anything else.

So if I have 80,000 records I need to process, I will often loop around, do the processing in a thread, and then join it back up at the end.

This doesn't give me any speed increase, but it does often mean I don't get memory overflows as the data processed in the thread is easily garbage collectable.

Oh, what I don't like about cfthread? on ACF, I'm limited by my Licence. That drives me nuts.