0

I'm using quite a few cfthreads in a scheduled task (because cf runs out of memory otherwise), and now I'm getting the following error:

Cannot create a new thread because the task queue has reached it maximum limit 5000.

So here are my questions:

  1. what is the "task queue" exactly, and where are the docs?
  2. how do I increase this limit?
  3. how can I determine what the limit is dynamically? and how many threads are already in the queue?
erikvold
  • 15,988
  • 11
  • 54
  • 98

2 Answers2

1

Why not use the run-join idiom I provided as an answer to another question of yours: many queries in a task to generate json? You could alter that code example to create several threads and then join if you're looking for things work asynchronously. In addition, having as many threads as your question describes actually slow things down because the server spends too much time context switching between threads.

Community
  • 1
  • 1
orangepips
  • 9,891
  • 6
  • 33
  • 57
  • good point, I"m running 50 threads at a time now and joining the 50 threads after running them, this seems to be working well. – erikvold Mar 09 '11 at 15:40
0

It looks like the limit is a built-in limit that cannot be changed.

The message above is an error message though, so you could wrap the cfthread in a cftry to find out when the limit is reached.

erikvold
  • 15,988
  • 11
  • 54
  • 98