Hello,

I did some experiments with developing harmony portlib over APR.
The main problem for me is an APR memory model.
It is well suitable only for transactions.

There is no free() memory call. You could destroy only whole memory pool.
This works well only for short living threads or tasks. This is
typical for HTTP server, not Java application. (All apr_*_create
functions require apr_pool_t* as argument)
I tried to create sub-pool for each object as workaround. This hits
memory footprint and performance.
So APR memory model should be extended. For example portlib memory
pools could be integrated into APR.

The second problem is ugly "Developing wrappers over wrappers".
For example, a call stack for read() method will look like following,
in case we will develop Portlib over APR:

Java_java_io_FileInputStream_read() calls
portlib->hyfile_read(portLib...) calls
apr_file_read(apr_file, ...) calls
read(....) system calls.

If we change portlib interface to be apr compatible, call stack could
be a little bit better:

Java_java_io_FileInputStream_read(...) calls
portLib->apr_file_read(portLib->files[fd], ...) calls
read(...) system calls.

And definitely we will need to add a lot of new functions into APR.

Thank you,
Artem Aliev
Intel Middleware Products Division

Reply via email to