zdm has asked for the wisdom of the Perl Monks concerning the following question:
Hello.
Following code produce segmentation fault:
but if i require FCGI first time in thread, such as:#!/usr/bin/env perl use v5.16.3; use threads (exit => 'threads_only'); use threads::shared; use FCGI; threads->create(\&thread); threads->create(\&thread); threads->create(\&thread); while (threads->list(threads::all)) { sleep 1 } #wait until has thr +eads sub thread { sleep 3; threads->detach; threads->exit; return; } 1; __END__
thread can exit without any errors.#!/usr/bin/env perl use v5.16.3; use threads (exit => 'threads_only'); use threads::shared; threads->create(\&thread); threads->create(\&thread); threads->create(\&thread); while (threads->list(threads::all)) { sleep 1 } #wait until has thr +eads sub thread { require FCGI; # <--- HERE IS THE DIFFERENCE sleep 3; threads->detach; threads->exit; return; } 1; __END__
This bug prevent use FCGI.pm with threads. Does somebody has a working solution to use FCGI in main thread?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: [FCGI.pm] - not threads-safe?
by BrowserUk (Patriarch) on Aug 19, 2013 at 19:03 UTC | |
by zdm (Beadle) on Aug 20, 2013 at 10:29 UTC | |
by BrowserUk (Patriarch) on Aug 20, 2013 at 13:13 UTC | |
by zdm (Beadle) on Aug 20, 2013 at 14:15 UTC | |
by BrowserUk (Patriarch) on Aug 20, 2013 at 14:30 UTC | |
| |
Re: [FCGI.pm] - not threads-safe?
by sundialsvc4 (Abbot) on Aug 19, 2013 at 18:54 UTC | |
Re: [FCGI.pm] - not threads-safe?
by Anonymous Monk on Aug 20, 2013 at 21:18 UTC | |
by BrowserUk (Patriarch) on Aug 20, 2013 at 21:29 UTC | |
by Anonymous Monk on Aug 20, 2013 at 22:36 UTC | |
by BrowserUk (Patriarch) on Aug 20, 2013 at 23:12 UTC | |
by Anonymous Monk on Aug 21, 2013 at 00:08 UTC |
Back to
Seekers of Perl Wisdom