in reply to Re: Event module and threads/fork segfault on Win32
in thread Event module and threads/fork segfault on Win32

I create the thread and join it inside the same watcher just to make things simple. In real life, there is a watcher that starts them on demand and there is another that joins them to collect their exit statuses.
That's why I cannot start the thread at the start of the script. They are created when a client makes a request.

Thanks for the link to Glib, I'll give a try, but I cannot found Glib nor Gtk2 in ActiveState Perl package manager. Searching in Google I found gtk2-perl Win32 Binary Home. Is this the right place?

  • Comment on Re^2: Event module and threads/fork segfault on Win32

Replies are listed 'Best First'.
Re^3: Event module and threads/fork segfault on Win32
by zentara (Cardinal) on Jun 05, 2007 at 16:32 UTC
    I don't use Win32, but try Install GTK2 or gtk2-win32 support

    Glib is the base library for Gtk2. It does not need a gui and is developed to be thread-safe( as demonstrated by my previous example). I would be willing to bet that Event.pm is not thread-safe. The author talks alot about threads in the Event.pm perldoc, but never mentions the thread-safety of Event.pm

    So I'm willing to bet it acts like Tk, and you have to start the threads before any Tk code is called.... I generally use a "sleeping thread" where I have a thread code block controlled by a $go shared variable. That way you can use Event, by starting the thread before any Event code is written, then in your create_thread callback, just set $go to 1 to get the thread running. If you need help on how to do that, just use the SuperSearch for "Tk threads" and you will find many examples of a sleeping thread.

    This is from the Perl/Gtk2 maillist:

    From: Gabor Szabo <szabgab@gmail.com> For ActiveState users * I assume you already have ActiveState Perl installed on your system. If not, download and install ActiveState Perl from http://activestate.com/Products/ActivePerl/ * Next you need to install the GTK+ 2.x.x runtime environment. The latest version can be downloaded from http://gimp-win.sourceforge.net/stable.html * Ensure that the <INSTALL_PATH>\GTK\2.0\bin directory is in your PATH after this installation. * Next you need to install the Win32 binary packages for gtk2-perl. Download and install the latest version of Gtk2.ppd and Glib.ppd from http://gtk2-perl.sourceforge.net/win32/ppm/ (Another way to install these ppds is as follows C:\Temp> ppm install http://gtk2-perl.sourceforge.net/win32/ppm/Gtk2.p +pd C:\Temp> ppm install http://gtk2-perl.sourceforge.net/win32/ppm/Glib.p +pd ) Your system should be ready to roll !

    I'm not really a human, but I play one on earth. Cogito ergo sum a bum
      Thanks a lot! I'll give it a try.