call process from servlet

Hi,

In my jsp(or servlet),

I took the parameters and by using Runtime's exec() method, I call a windows process to do some work.

As the jsp runs in the server, a lot of concurrent requests can be made to jsp.

But the windows' exe can not run concurrently. What I must do is, to take the requests, if the exe is available run the exe, if it is not, wait for its work to be completed then run the exe. Thus put the request in the queue.

It is not important how long the clients wait.

I think I must use some other technologies inside the jsp, like

JMS or

concurrent porgramming or

threads or

something else.....

What is it?

Does anyone has any idea?

thanks

[741 byte] By [esesa] at [2007-11-26 16:33:18]
# 1

You can set your Servlet container to run in single-threaded mode. This will be bullet proof; however, it may overly limit how many requests you process. Another option would be to synchronize the doGet() and doPost() methods in your Servlet. And you can, if desired, obtain even finer grained control over synchronization via java.util.concurrent classes.

- Saish

Saisha at 2007-7-8 22:58:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...