473,394 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Reentrant POST

a
Hi,

I have the following setup: PHP 5.1.x on Apache 2.x on Windows XP.

A php script receives data from a form upon user submit, and then execs a
Windows process, which may take some time to complete (actually this process
performs a quite complex task which involves starting another process and
then requesting a Windows service to perform yet other tasks). Everything
works fine as long as the user submits the form and then patiently waits for
the processing to end. However, if the user clicks on submit while the php
script is still waiting for the windows process to end, than the browser
will remain in this state indefinitely, the Windows processes never complete
their tasks and sometimes Apache crashes.

Is there a way to handle this so the work in progress is either allowed to
end or instructed to stop, before moving on to processing the new submit?

Thanks,

A
Feb 4 '06 #1
2 1828
a wrote:

Is there a way to handle this so the work in progress is either allowed to
end or instructed to stop, before moving on to processing the new submit?


I think you've misunderstood the meaning of 'reentrant'.

Interfering with the existing process is not trivial. Wouldn't it be simpler
to not allow the user to POST more than once - something like:

<input type='button' id='submitId' onclick='
if (document.getElementById("formId").onsubmit()) {
document.getElementById("submitId").disabled=true;
document.getElementById("formId").submit();
}' value='Submit'>

C.

Feb 5 '06 #2
a
Thanks for your reply.
I think you've misunderstood the meaning of 'reentrant'.

By "reentrant" I meant that the user would POST while a previous POST is
still being processed on the server.
Interfering with the existing process is not trivial. Wouldn't it be
simpler
to not allow the user to POST more than once - something like:

<input type='button' id='submitId' onclick='
if (document.getElementById("formId").onsubmit()) {
document.getElementById("submitId").disabled=true;
document.getElementById("formId").submit();
}' value='Submit'>


Yes, this would prevent the user from resubmitting a form, but there is also
the issue of allowing the user to cancel a lengthy processing, in which case
a new post would still have to be sent.

I'm leaning now more toward an asynchronous solution in which the windows
process that is exec-ed by the php script starts another process to do the
actual work and then returns immediately, allowing the php script to
continue. There will have to be a synchronization mechanism between the
working process and the php script that will signal when the data is ready,
or will allow the processing to be canceled.

A
Feb 6 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Adrian Parker | last post by:
For some reason when I call validateFields before .Update (see below), I get this error: "Consumer's even handler called a non-reentrant method in the provider" However if I comment out the...
0
by: Martin B | last post by:
Hallo to everyone! Problem: -------- GridView Exception: reentrant call to the SetCurrentCellAddressCore function System: ------- WinXP Professional, english, .NET Framework 2.0 Beta...
6
by: junky_fellow | last post by:
what are reentrant functions? What are the characteristics of a reentrant code ? what things should be kept in mind while writing a reentrant code ?
2
by: TheOne | last post by:
Would anyone please point me to a list of reentrant GNU C/C++ library functions? I have searched a lot on the web for it but without any success. Man page of signal(2) has listed system calls...
9
by: TheOne | last post by:
Would anyone please point me to a list of reentrant C library functions? I want to know which C library functions are safe to use inside a signal handler across all platforms. Does GNU C library...
1
by: jj_online | last post by:
This is not a C++ specific issue. However, I am trying to implement a readwritelock in C++ and hence would like to get help from this group. a readwritelock allows shared lock among all readers...
17
by: fmassei | last post by:
Dear all, I'm trying to put some old code in a portable, cross-platform library and I'm facing a big problem: is there a standard, platform- independent way to write a reentrant function that...
12
by: Bit Byte | last post by:
I am modifying some legacy code, to make the functions reentrant. I use lots of global data (large nested structs) to pass data around quicky. The global structures are far too large (in size) for...
5
by: Roland Mainz | last post by:
Hi! ---- Does anyone here know any XML parsers which are reentrant, threadsafe, maintained (e.g. the project should still be active+alive) and written in ANSI-C (libxml2 is unfortunately not...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.