lkml.org 
[lkml]   [2003]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: /proc reliability & performance
On Fri, Oct 17, 2003 at 12:31:14AM -0400, Albert Cahalan wrote:
> Count tasks as you read them. The number is
> your directory offset. Return a few dozen entries
> at a time. For each read, you'll need to find
> back your place. You do this by counting tasks
> until you reach your offset. Of course, tasks
> will have been created and destroyed between
> reads, so who knows where you'll continue from?
> That's simply not reliable.

That's part of what the rbtree algorithm was meant to address.
It does find_tgids_after(tgids, tgid_array), filling a buffer with the
tgids starting at the first one higher than its first argument. This
way there is no possibility whatsoever of duplicates or deviation from
sorted order.


-- wli
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:58    [W:0.043 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site