Kim Karlsson *nix forums beginner
Joined: 21 Feb 2005
Posts: 1
|
Posted: Mon Feb 21, 2005 12:18 pm Post subject:
Callback from threaded c-library
|
|
|
Hi all,
I am using Perl 5.8.0, using Red Hat 9 with a 2.6.9 kernel on a dual-Xeon
machine,
and I shared object I need to use. This shared object has a working thread
which calls a callback when it has finished working.
I have written an extension (following the instructions (the one with the
FH) in
http://www.tfug.org/helpdesk/perl/pod/perlcall.html#Strategies_for_storing_Calback_)
in Perl to access this shared object.
The problem I have is that if the thread calls the callback (to a Perl
sub), I get a segmentation fault. If the callback is called before the
thread starts executing, it all works fine. If I use a C program to setup
the callback and have the thread call the callback, it all works. Thus it
seems there is something going wrong with Perl.
The odd thing is that it crashes -before- it enters the private C function
that calls the Perl sub.
Are there any knows issues with Perl and external threads that I don't
know about, or does anyone know what I can do ?
Cheers,
-Kim |
|