Handling non-thread safe libraries due to globals

Alison Gravley alison.m.gravley at gmail.com
Wed Aug 21 15:52:27 UTC 2024


I have a C library that isn't thread safe due to globals. Normally this
would result in us running multiple applications for each instance we
needed, but wondered if there was a another way to achieve this. I might
even be wrong, and due to the way we wrote things it will work anyway.

To provide a little bit of context we wrote a Java library, call it Device
Client Library, that uses this C library to make a single connection. In
your application, you create a Device Client object for each connection you
need to make. My understanding is this still doesn't give the separated
memory space needed for the globals or do the right kind of operating
system calls to allow this to work the same way multiple running
applications would.

Is this correct? Is there maybe something we could modify in the Runtime
Helper to get around this limitation so we don't have to have 30-40
applications running?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/jextract-dev/attachments/20240821/9c94d590/attachment-0001.htm>


More information about the jextract-dev mailing list