|
From: Andrei S. <and...@gm...> - 2008-07-28 22:29:04
|
On Tue, Jul 29, 2008 at 1:16 AM, Nicholas Nethercote < nj...@cs...> wrote: > On Mon, 28 Jul 2008, Andrei Soare wrote: > > I need help again, this time the problem is with threads. I have added a >> skip list structure to ms_main.c and have encountered a thread error in >> the >> function that adds a node to a list. >> I would really appreciate some help. >> > > Rather than debug your code for you, I'll suggest that you use either the > VgHashTable data structure (include/pub_tool_hashtable.h) or the OSet > (include/pub_tool_oset.h) data structure. OSet is a bit more general but > also a bit harder to understand how to use it. > > Nick > That will not help me, I don't need a hash table. I need a data structure which will keep all the allocations sorted (so it has to be an ordered list) and I need fast searching within that list (for that, skip lists are the best). Otherwise, I have tried implementing a simple linked list (in which i can search with linear complexity) and it takes hours to run a program under valgrind. Skip lists have a complexity of O( log(n) ). -- Andrei Soare |