in reply to WWW::Curl and making it thread safe

Greetings lsuchocki, and welcome to the Monastery.

Try having the worker exit via threads->exit on Windows.

use threads; use WWW::Curl::Multi; my $x = WWW::Curl::Multi->new(); if (fork == 0) { #Do stuff NOT related to WWW::Curl here.. print STDERR "thread sleeping\n"; sleep 1; print STDERR "thread exiting\n"; threads->exit(0) if ($^O eq 'MSWin32' && threads->can('exit')) +; exit(0); }


If the issue persists, try exiting via POSIX::_exit. That avoids all END and destructor processing for non-threads spawned via fork.

use POSIX (); use WWW::Curl::Multi; my $x = WWW::Curl::Multi->new(); if (fork == 0) { #Do stuff NOT related to WWW::Curl here.. print STDERR "thread sleeping\n"; sleep 1; print STDERR "thread exiting\n"; POSIX::_exit(0); }


Regards, Mario