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.

marc esher
  • 147
  • 2
  • Hi Marc. Questions asking for sharing experiences, polls, and similar type questions are not a constructive question per the [FAQ](http://programmers.stackexchange.com/faq). – maple_shaft Apr 06 '12 at 01:09
  • 2
    so where's a good place on the Stack* network to ask this? – marc esher Apr 06 '12 at 02:57
  • As far as I know, none. All of the SE sites are Q&A sites and we all try to discourage discussions and polls. If not then we just become another Yahoo Answers filled with content that isn't useful to anybody. We do have the chat room link however that allows users to ask such questions and get real time responses however so i suggest trying that. – maple_shaft Apr 06 '12 at 13:23
  • 2
    When I first came to the site, I saw this: http://screencast.com/t/5E3HxHKq (It is no longer there after logging in). If Marc's question is not considered 'conceptual' than we obviously use drastically different definitions of the word. Also, maple_shaft, can you tell me why this question, http://programmers.stackexchange.com/questions/24936/concurrency-how-do-you-approach-the-design-and-debug-the-implementation, was not 'closed' for the same reason? – Scott Stroz Apr 06 '12 at 14:56
  • 1
    More questions that should be closed based on your criteria: http://programmers.stackexchange.com/questions/177/what-is-your-thoughts-about-the-actor-model http://programmers.stackexchange.com/questions/30057/how-much-configurability-to-give-to-users-regarding-concurrency http://programmers.stackexchange.com/questions/57809/python-threading-vs-multiprocessing-should-i-learn-one-before-the-other Each of those questions fall into the same categories of 'no nos' you stated for this one. Why the discrepancy? – Scott Stroz Apr 06 '12 at 15:09
  • Hell - just about every 'related' question linked over there ---> can be 'closed' for "sharing experiences, polls, and similar type questions" – Scott Stroz Apr 06 '12 at 15:14
  • Yet another example of a question would not fall within the 'scope' of StackExchange - http://programmers.stackexchange.com/questions/139536/how-to-minimize-typos-when-you-code – Scott Stroz Apr 07 '12 at 14:41

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 :)

Jas Panesar
  • 151
  • 1
  • 2
  • 6
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.

Mark Mandel
  • 141
  • 2