in reply to Re: Re: Re: Re: Externally managed threads using embedded Perl
in thread Externally managed threads using embedded Perl
I find C++ much more productive that Perl - I guess it's just a question of what you know <g>.
Well, I know (or perhaps, knew once) C++ also, and I find Perl infinitely more productive. But then again, I hated C++ from my first encounter. Time and experience only made things worse -- but I know I am in a minority in that view:)
BTW, if I:will $spamtest be available in the clone if I perl_clone after this Perl code is executed?my $spamtest = SpamAssassin::Mail::SpamAssassin->new(...) : shared;
I've never seen anyone use that syntax before, and a quick test seems to indicate that you cannot use :share in that way.
use threads; use threads::shared; use Benchmark::Timer; $T = Benchmark::Timer->new() : shared; Unquoted string "shared" may clash with future reserved word at (eval +3) line 1, <> line 2. syntax error at (eval 3) line 1, near ") :"
Any attempt to share a blessed reference usually results in an error.
use threads; use threads::shared; use Benchmark::Timer; { my $T : shared; $T = Benchmark::Timer->new(); } Invalid value for shared scalar at (eval 5) line 1, <> line 5.
So, I think the short answer is no.
I assume you were hoping to share a single instance of spamassasin between the multiple interpreters. This will not work.
Creating a unique instance in each interpreter would(may) probably work, but I have no idea how much memory that would consume.
That would require a piece of suck-and-see engineering I am afraid. Unless anyone else knows better.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: Re: Externally managed threads using embedded Perl
by Anonymous Monk on Jan 08, 2004 at 07:18 UTC | |
by BrowserUk (Patriarch) on Jan 08, 2004 at 07:34 UTC |