Yes, there is a 'fork' implementation in Perl for Windows. But is very 
different from the one that is running in other OS's. Windows does not 
know a system call 'fork'. So Perl has to emulate this call in Windows 
(using iThreads). 

There are some very good reasons for us, to never use 'fork' (except the 
'start as daemon' section)!
The major reason is: If you want to fork (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.

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

Thomas






"GrayHat" <gray...@gmx.net> 
15.06.2009 09:12
Bitte antworten an
GrayHat <gray...@gmx.net>; Bitte antworten an
ASSP development mailing list <assp-test@lists.sourceforge.net>


An
"ASSP development mailing list" <assp-test@lists.sourceforge.net>
Kopie

Thema
Re: [Assp-test] ASSP hangs







>> Fritz... why don't you just "fork" the report generation ?

> Because we have already developed V2. It is NOT a simple task to
> "fork" in all platforms. Especially not in Windows. Therefore a lot of
> work went into the multithreading version.

Uh ?!?

#!/usr/bin/perl

my $pid = fork();
if (not defined $pid) {
  # uhm
  print "resources not available.\n";
} elsif ($pid == 0) {
  # this is the child code, here we'd call
  # the report generation function which
  # will run in a separate, child process
  print "ASSP (child): generating reports\n";
  sleep 5;
  print "ASSP (child): reports generated\n";
  exit(0);
} else {
  print "ASSP (main): Report generation running...\n";
  # wait not needed in ASSP, just for demo...
  # in assp we'll keep doing our job while
  # the forked child will process the emails
  # and generate the reports
  waitpid($pid,0);
}
print "All done\n";


the above works w/o problems in windows, and I suspect it should
work well on Linux, MacOSX and others, and well... implementing
such a simple "fork" shouldn't be so complex in 1.x; again I'm not
referring to multithreading, just to fork child processes if and when
needed (e.g. to handle report generation and similar "batch" tasks)




------------------------------------------------------------------------------
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



DISCLAIMER:
*******************************************************
This email and any files transmitted with it may be confidential, legally 
privileged and protected in law and are intended solely for the use of the 

individual to whom it is addressed.
This email was multiple times scanned for viruses. There should be no 
known virus in this email!
*******************************************************

------------------------------------------------------------------------------
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