From 51505cb08a3d58fe8505737689cb78ffea14420c Mon Sep 17 00:00:00 2001 From: Alexandre Deckner Date: Sun, 11 Jan 2009 03:08:56 +0000 Subject: [PATCH] * The pose adding thread was going too fast, opening too many files (those are closed by the window thread), and reaching the file descriptor limit. For some still unknown reason, this was causing GetNextDirents to stop returning new entries. The result was that, on populated folders, Tracker wouldn't load all poses and stop at a random amount. We now take a more conservative approach and close the files before sending, reopening them on reception. Now the AddPoses thread is a bit too aggressive, especially on second runs, i needed to add some snoozing otherwise it would stall Tracker for several seconds. (testing on a 20000 files folder). This fixes #3054 git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28872 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/tracker/PoseView.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/kits/tracker/PoseView.cpp b/src/kits/tracker/PoseView.cpp index 3b38e4e3c1..efd007c641 100644 --- a/src/kits/tracker/PoseView.cpp +++ b/src/kits/tracker/PoseView.cpp @@ -1334,6 +1334,7 @@ BPoseView::AddPosesTask(void *castToParams) // probably more correct. // clean this up + model->CloseNode(); modelChunkIndex++; } @@ -1359,6 +1360,8 @@ BPoseView::AddPosesTask(void *castToParams) posesResult = new AddPosesResult; posesResult->fCount = 0; + + snooze(500); // be nice } if (!count) @@ -1613,6 +1616,7 @@ BPoseView::CreatePoses(Model **models, PoseInfo *poseInfoArray, int32 count, continue; } + model->OpenNode(); ASSERT(model->IsNodeOpen()); PoseInfo *poseInfo = &poseInfoArray[modelIndex];