On 19 Jul 2001 15:07:31 +1000, Mark Lillywhite wrote:
>
> > handle concurrent requests. I simply cannot queue up all
> > the requests and process then one at a time.
>
> Why not? It would be pretty easy to make a queue up that processes
> FOP objects serially, blocking the servlet thread until the
> requested object is formatted. With a centralised Queue you could
> then select the number of FOP processors that are processing the
> entries on the queue. I have a nice multithreaded Queue
> implementation that allows multiple servers on a single queue
> with multiple submitters - it doesn't block the enqueue caller,
> but that wouldn't be too difficult. That way you can have the
> right number of threads for the number of CPUs you have, and you
> should get better overall performance and much less memory usage.
> Sure, the servlet thread(s) will block waiting for processing, but
> that's what happens anyway, right?
I agree with you here. I'm in favor of using a thread pool to regulate
the FOP processing but that violates our 'guidelines and best practices'
of not to use threads in user code. This is to make the poor guy who
replaced Weiqi have an easier life maintaining the code.
I also have the code to queue up requests, inspired by Allan Holub's
articles, and later a book, on Threading in JavaWorld. It uses the
Active Object pattern, which is described in Doug Schmidt's book on
Pattern Oriented Software Architecture II
(http://www.cs.wustl.edu/~schmidt/).
--
Weiqi Gao
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]