celix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sascha Zelzer <s.zel...@dkfz-heidelberg.de>
Subject Re: [DISCUSS] APR Usage
Date Mon, 14 Oct 2013 21:54:52 GMT

I agree that we should strive for a Native-OSGi API which does not 
depend on third-party libraries. Having said that, I also think that if 
such a C API gets too cumbersome and complicated to use, we should 
rethink this requirement.

Without a specific memory ownership management technique (like APR 
memory pools), the C API of services obviously needs to be carefully 
crafted if the service interface is stateful (e.g. internally keeps a 
pointer or reference via a method call). In this case, the service 
likely needs to provide additional methods which can be used to clear 
the internal state (e.g. signal the withdrawel of a previously passed 
pointer because the calling bundle is being unloaded). I don't see a 
problem with adapting the original Java service interfaces to better 
meet the specifics of C (or C++).

Transferring memory ownership to a service from another bundle probably 
needs a mixed approach, if APR memory pools are used internally in C a 
implementation like Celix (like Alexander mentioned). But I am not 
conviced yet that this problem cannot be overcome by a carefully 
designed service interface.



View raw message