Re: APR Table vs. Hash & Array vs. Skip List vs. Ring

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On 27 May 2018, at 03:40, Simon Walter <simon@xxxxxxxxxx> wrote:
> 
> Hi everyone,
> 
> First of all, I am not sure if this is the right place to ask this.
> Please send me to the appropriate mailing list. Thanks.

What's the context?  Given where you asked, I'll guess you're writing
a module for your web server, in which case, there's a modules-dev list
for the next question.

> I want to know basically what the difference is between a table and a
> hash table - regarding the APR implementation.

The best place to look at APR is the source header files, which are the
level at which it's most comprehensively documented and easy to follow.

> The one difference that stands out to me is that I can iterate over a
> hash. So is a hash like a table with a linked list?

No.

> Perhaps a table can also be iterated over too. I haven't used tables yet

You can iterate over a table, too: use its underlying array.

>  I see function names containing
> "merge" and "append", but the docs do not state how this is done.

The docs in the header files are pretty clear.

Also worth bearing in mind, apr_table's more esoteric functions originate in the
standards for manipulating HTTP headers.  If in doubt, assume the behaviour
follows HTTP.

Why not start with the simple: a C array of pointers void* my_array[N_ELTS],
or a linked list?  Once you've thought through the problems with those, you're
in a position to decide what struct will best serve you.

FWIW, the situation where I find an APR array helps most often over a linked
list is in making life easier in a configuration merge function.

-- 
Nick Kew
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx





[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux