G> Yes, I know that, I did my homework before suggesting the "fork" :)
G> http://www.xav.com/perl/lib/Pod/perlfork.html
G> but...
Please read your own source:

Since the fork() emulation runs code in multiple threads, extensions
"calling into non-thread-safe libraries may not work reliably when calling 
fork().
As Perl's threading support gradually becomes more widely adopted even on 
platforms
with a native fork(), such extensions are expected to be fixed for 
thread-safety. "

Are you shure all needed extensions are thread-safe? I think if it
would be easy to fork, ASSP would use it already.

Matti




>> There are some very good reasons for us, to never use 'fork' (except
G> the
>> 'start as daemon' section)! The major reason is: If you want to fork
G> (no matter
>> what OS you use), you have to make sure, that every used perl module
>> and its related XS-code and drivers are threadsave. This is not the
>> case for some of the  modules used by ASSP - for example : nearly all
>> DB-drivers (I do not know a single one that is threadsave), SSLeay and
>> some others.

G> I see and understand; but what I was suggesting was just to use the
G> "fork" call
G> to spawn time consuming / disk intensive tasks in a separate process w/o
G> having to use full multithreading but at the same time allowing ASSP to
G> perform
G> such functions; in the particular case (blockreports) most if not all
G> the "problem"
G> modules you're referring to shouldn't even come to play

>> There are some coding - technics to workaround this. V2 is using such
G> a
>> way. But at the point where V1 should 'fork' to do the Blockreports,
G> such
>> workaround seems impossible.

G> uhm....

G> our    $reportpid;

G> [...more code here...]

G> $reportpid = fork();
G> if ($reportpid == 0) {
G>     my $res = GenerateBlockReports();
G>     exit ($res);
G> }

G> [... regular ASSP code goes on here...]

G> at that point, the GenerateBlockReports() code should just pay attention
G> NOT to call mainloop/mainloop2 since it won't need to do so because all
G> the forked child has to do is examining the emails, generating the block
G> reports and send them, while the regular ASSP code will go on processing
G> incoming messages


G> 
------------------------------------------------------------------------------
G> Crystal Reports - New Free Runtime and 30 Day Trial
G> Check out the new simplified licensing option that enables unlimited
G> royalty-free distribution of the report engine for externally facing 
G> server and web deployment.
G> http://p.sf.net/sfu/businessobjects
G> _______________________________________________
G> Assp-test mailing list
G> Assp-test@lists.sourceforge.net
G> https://lists.sourceforge.net/lists/listinfo/assp-test



-- 
Matti Haack - Hit Haack IT Service Gmbh
Poltlbauer Weg 4, D-94036 Passau
+49 851 50477-22 Fax: +49 851 50477-29
http://www.haack-it.de



------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Assp-test mailing list
Assp-test@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/assp-test

Reply via email to