Link to home
Start Free TrialLog in
Avatar of lazyelm
lazyelm

asked on

Forking not speeding anything up?????

i am forking a call to another php script becuase it must connect to a mail server.  It can take up to a minute to send depending on attachments and network traffic and other factors.

here is the code i am using to call the scrip that does the email functions

exec("start c:\php\php d:\web_projects\ltrak\wwwroot\forked.php > NUL &");

When i call the script this way, it still waits for  the exec to return so it does not speed anything up.  I thought forking was meant to start a new process so that the current one can continue on with what it is doing.

Any ideas?

platform is win2k pro php 4.3.3 iis5
Avatar of aolXFT
aolXFT

try calling a program that returns before it is actually finished sending the mail.

The program would spawn another process, return and let the child process do the work.

It would probably have to be written in C/C++

Alternatively you could cache the necessary mails to be sent, and use the Windows Equivlent of a Cron job EG wincron.
ASKER CERTIFIED SOLUTION
Avatar of inq123
inq123

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial