Skip to content
Prev 32109 / 398525 Next

Reloading a shared library with dyn.load

Prof Brian Ripley wrote:
This is not true.  The unloading of a shared library automatically
unregisters the entry points (the routine Rf_freeDllInfo in
Rdynload.c). So using the registration is not a problem.

Checking this on both my Linux and Windows boxes running 1.7 patched
doesn't cause any problems.  Adding a static variable to the
HelloFromC routine and both incrementing it and adding its value to
the returned string in each call illustrates that when a second
dyn.load() call is made, a new version of the library comes in.

So I can't reproduce the problem directly from the commands.
Something that comes to mind is that another process has got a lock on
the file. But I don't see that as likely.
This is *NOT* a necessary precaution.  Registration has the potential
to improve this situation rather than diminishing it. So please don't
let this discourage people from using registration.

 D.

  
    
Message-ID: <20030516065528.A21287@jessie.research.bell-labs.com>
In-Reply-To: <Pine.LNX.4.44.0305160742380.9271-100000@gannet.stats>; from ripley@stats.ox.ac.uk on Fri, May 16, 2003 at 07:54:13AM +0100