kingkongrevenge has asked for the wisdom of the Perl Monks concerning the following question:
However, it's absolutely critical that the user plugins can bring compiled code with them, i.e. code that is not already linked in the executable. Plugins would occasionally be doing some computationally intensive stuff internally where pure Perl wouldn't cut it. Is this possible?
My understanding is that to use object code from the perl hosting process you have to generate the xs_init code and link in the resulting object file. Is there some black magic way to support this by manually hacking the xs_init? No multi-process solutions are acceptable, though the perl hosting process is free to re-exec itself during some initialization stage; all the plugins to use would be known at start-up.
This might boil down to more of an operating systems question than a Perl question. Are there any ways to tell an executable to arbitrarily "load" an object file? DLL-Injection/LD_PRELOAD? I'm fairly ignorant of these things, if you can't tell.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Can arbitrary XS/SWIG using modules be loaded into an embedded perl at runtime?
by Joost (Canon) on Jul 23, 2008 at 23:25 UTC | |
by kingkongrevenge (Scribe) on Jul 24, 2008 at 01:38 UTC | |
by kingkongrevenge (Scribe) on Jul 24, 2008 at 04:32 UTC | |
Re: Can arbitrary XS/SWIG using modules be loaded into an embedded perl at runtime?
by diotalevi (Canon) on Jul 24, 2008 at 04:37 UTC |