[JDEV] Multithreaded Component question

Peter Millard me at pgmillard.com
Tue Jan 6 12:22:20 CST 2004


Henky Wibowo wrote:
> I am trying to understand how JECL-based component handles multi-threaded
> connection from the server. I have a component that perform database lookup
> and sometimes it takes a while to complete. When this happens, all requests
> to the component basically gets put on hold until the processing is
> completed. How do I get the component to process simultaneous requests? Is
> there a good documentation on the innerworking of JECL?

All packets coming into your component (via onPacket) arrive in the socket's
thread (which never changes). If you want to have multiple threads, you should
create your own thread-pool inside your component, and enqueue operations into
those threads so that onPacket returns. Thats the general idea.

pgm.




More information about the JDev mailing list