Callback from threaded c-library

From: Kim Karlsson (kimdotkarlsson_at_lucdotac.be)
Date: 02/21/05


Date: Mon, 21 Feb 2005 14:18:04 +0100

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



Relevant Pages

  • Re: Opening files on the web for reading
    ... the thing invoking the callback has to be "in control". ... Perl, it would be nice if perl could handle the messy stuff for me:). ... Many live that deserve death. ...
    (comp.lang.perl.misc)
  • Re: Tk-LineNumberText -0.5 does not work
    ... documentation and the code failed. ... This is perl, v5.8.8 built for MSWin32-x86-multi-thread ... Tk callback for event ...
    (comp.lang.perl.tk)
  • Re: HTML parsing
    ... > I am completely new to Perl and am needing some help with a short script I ... Your text callback can then sent a flag to tell the link callback to ... You are suffering from preature declaration again. ...
    (comp.lang.perl.modules)
  • Re: Tk-LineNumberText -0.5 does not work
    ... I was trying to see if the module "Tk-LineNumberText" V0.5 worked for some thing I was planning to do. ... This is perl, v5.8.8 built for MSWin32-x86-multi-thread ... Tk callback for event ...
    (comp.lang.perl.tk)
  • Re: Object oriented gui with Perl/Tk ... how can I make this work?
    ... I wouldn't say perl has better OO than Java, ... > use a closure for the callback and close on $self. ... > do that inside Populate and use it for the -browsecmd value. ...
    (comp.lang.perl.misc)