Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Forking not speeding anything up?????

Posted on 2003-11-06
2
Medium Priority
?
222 Views
Last Modified: 2008-03-06
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
0
Comment
Question by:lazyelm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Expert Comment

by:aolXFT
ID: 9695649
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.
0
 
LVL 8

Accepted Solution

by:
inq123 earned 2000 total points
ID: 9698315
Hi lazyelm,

My guess is that you would also need to redirect STDERR, e.g.:

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

Cheers!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question