开发者

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

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. 开发者_运维百科
  4. how can I determine what the limit is dynamically? and how many threads are already in the queue?


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜