You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by Justin Mason <jm...@jmason.org> on 2004/02/24 19:23:19 UTC

Re: Problems running SpamAssassin in a thread ...

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


"Nick Djurovich" writes:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>> 
>> On Tuesday 24 Feb 2004 11:53, Nick Djurovich wrote:
>> >
>> > Perl 5.8.0
>> >
>> > When I use a perl script that spawns a thread that does the spam 
>> > check, PerMsgStatus throws an error causing the thread to 
>> fail. If i 
>> > run the same code normally (ie not in a
>> > thread) it works fine.
>> >
>> > After I put a few debugging statements into PerMsgStatus.pm 
>> around the 
>> > error line (1750), I found that the string $uriRe has been 
>> corrupted. 
>> > It should contain a large Regular Expression, but it only contains 
>> > some of it, and them alot of garbled data).
>> 
>> There are a number of thread related fixes in perls higher 
>> than 5.8.0. I suggest if you wish to use threads you upgrade. 
>> Or try adding the CPAN forks.pm module to change your threads 
>> implementation to use forking instead.
>> 
>> Perl threads are very inefficient btw. You'd be better off 
>> using spamd.
>> 
>> - --
>> Matt.
>
>Hi Matt,
>
>Well, thats the thing, I wanted to test it out and see *how*
>stable they were. Case of falling over at the first hurdle :/
>
>I'm intentionally not using fork, to keep what I have done
>portable to Win32. I was thinking of just writing a module to 
>manage perl processes, ie spawn, kill, stop, etc.
>
>I basically want a pool of X processes handling emails (using
>SpamAssassin as part of that process), using a DB as a state
>machine to determine the current process of each email.
>
>I think I will persist a little further with threads.

Hi Nick --

IME, threads in perl are unusable, I'm afraid.   I'd suggest
avoiding them :(

- --j.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Exmh CVS

iD8DBQFAO5aXQTcbUG5Y7woRAgb9AJ9PWZN/zP4PBc3ldEuvi+qNGpmOLACdEm+r
EYvC7t4WyN3BpOhwoN3PFBI=
=sOjN
-----END PGP SIGNATURE-----