Closed lehenbauer closed 12 years ago
This is an extra problem because stapi defines speedtables one-shared-library-per-table.
Fixed by commit 026f3ca78c89cc9dd3f11b6d261c5ea1fb583e43
Test environment wasn't working as expected. Problem is not fixed under at least some circumstances.
Fixed by commit 6eb2e96aa47838505fd978dbd84f3afc22d362d5
There is a fundamental structural problem with multiple segments due to non-relative addressing necessitating inheriting the shared memory or attaching to the segments in the same order as the owner, but it seems to be working OK now.
There are also potential issues with cleanly detaching multiple segments but they can be worked on later.
If a second speedtables C shared library attempts to create a shared memory speedtable, it will malfunction. The previously defined tables will return results from the most recently defined one.
Comments in ctables/shared/shared.c indicate that some static variables need to be shared between C extensions for this to work.
While the ultimate fix would be to take the C files that are #included in each C extension into its own shared library, this will be tricky and I anticipate compatibility problems between autoconf-generated stuff and different operating systems following this path.
A much easier alternative would be to use the associated data (Tcl_GetAssocData) facility of Tcl interpreters to create a small structure containing the previously static variables, have the first extension create it and further extensions get a pointer to it. This should fix the problem.