On Thu, 21 Dec 2023 09:37:57 GMT, Joachim Kern <jk...@openjdk.org> wrote:

>> src/hotspot/os/aix/porting_aix.cpp line 916:
>> 
>>> 914: constexpr int max_handletable = 1024;
>>> 915: static int g_handletable_used = 0;
>>> 916: static struct handletableentry g_handletable[max_handletable] = {{0, 
>>> 0, 0, 0}};
>> 
>> Wouldn't `ConcurrentHashTable` be a better data structure? It is already 
>> used in hotspot, can grow dynamically and doesn't need linear search.
>
> There will be only few libraries in the list. With this assumption Thomas 
> suggested to use just a simple array.

Let's keep it simple. A linear array of only a few items is easily scanned, 
probably faster than pointer hopping hash table entries. Not that it matters in 
any way for the few calls to dlopen.

Also, avoiding hotspot structures preserves layer integrity (porting_aix does 
not pull anything from hotspot so far) and prevents initialisation time 
dependencies. Not sure whether ConcurrentHashTable works before VM init, but 
with Joachimes current solution, we can call dlopen at any time in VM life.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/16920#discussion_r1433839119

Reply via email to