Am 04/21/2008 08:52 PM schrieb Robert Bradshaw: > Is the callback being used in an asynchronous way? If so, you may have > to acquire the GIL (Search for GIL and pyrex/cython/python for a basic > background on what the GIL is).
No, everything runs in one thread.
I've got a wrapper class for the C plugin instances, where the
init-method looks like this:
cpdef class PluginInstance:
[...]
cpdef init(self):
self.__definition.init(self.__definition, NULL, 0, NULL)
self.__definition.init is a pointer to a functions in the plugin library
(callback). This function looks like this:
static void min_init (plugDefinition *plug, grabParameter *para, int
argc, char **argv)
{
int i;
printf ("min_init() of %s called with %d Argument(s)\n",
plug->name, argc);
puts("calling plug_observ_data");
plug_observ_data(plug, "image");
}
A typical session in python is this one:
>>> from ship.icewing import loader
>>> lib =
loader.registerLibrary("/home/languitar/BA-workspace/Plugin_Min/libmin.so")
>>> p = lib.factorInstance()
>>> p
<ship.icewing.general.PluginInstance object at 0x2af1a7b1a0d0>
>>> p.init()
min_init() of Min0 called with 0 Argument(s)
calling plug_observ_data
Speicherzugriffsfehler
The last line is the German word for segmentation fault.
This is generally all the logic happening in here.
Johannes
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
