First of all, APR is not a virtual machine or bytecode interpreter like that of.NET common language runtime or JVM. APR is a library (collection of functions) written in C, for C programs. It contains a lot of wrappers to the real standard C library functions, because some conventions of standard library still varies from OS to OS.
For example, the path separator is different in Unix ("/"), Windows ("\"), MacOS (":" - pre X, but also Finder in OS X). Another example is loading dynamically linked libraries
As other posts have pointed out, what GLib does is mostly the same; although GLib seems to be used mostly in client-side apps, I have written quite a few server programs quite comfortably with it.
Looking at the API it seems that GLib is a bit easier to use, while APR has some features that may lead to better performance, in particular memory pools (GLib does not have it, so all memory allocation are done by malloc(), saving a parameter but also losing a little flexibility).
Both are quite complete; but from a quick glance I can't find any data structure in APR that implements a sorted set/map, such as balanced binary trees or red-black trees or heaps, which seems to be quite handy when implementing timeouts (you always need to get the timeout that will expire first in order to provide the "timeout" parameter for "select"). Does anyone know how to solve this problem?
Some info on APR ... (Score:5, Informative)
First of all, APR is not a virtual machine or bytecode interpreter like that of .NET common language runtime or JVM. APR is a library (collection of functions) written in C, for C programs. It contains a lot of wrappers to the real standard C library functions, because some conventions of standard library still varies from OS to OS.
For example, the path separator is different in Unix ("/"), Windows ("\"), MacOS (":" - pre X, but also Finder in OS X). Another example is loading dynamically linked libraries
GLib (Score:2)
Looking at the API it seems that GLib is a bit easier to use, while APR has some features that may lead to better performance, in particular memory pools (GLib does not have it, so all memory allocation are done by malloc(), saving a parameter but also losing a little flexibility).
Both are quite complete; but from a quick glance I can't find any data structure in APR that implements a sorted set/map, such as balanced binary trees or red-black trees or heaps, which seems to be quite handy when implementing timeouts (you always need to get the timeout that will expire first in order to provide the "timeout" parameter for "select"). Does anyone know how to solve this problem?