You can easily avoid this problem by introducing an abstraction layer which is called by the servlet and which maps the calls to the one internal thread, which is associated with native libs. You can use a queue to synchronize the calls.
regards Leon On 3/21/07, kz <[EMAIL PROTECTED]> wrote:
Hi, Is it possible to configure Tomcat so that it spawns just one thread for calling all the methods of native code (the native methods are called from servlets)? Actually I am having a problem that I call a native method (C++ is the native language) and from the native code I initialiize some pointers (COM interface pointers). The problem is that when Tomcat uses a different thread to call a different method of the same DLL then the pointers which were initialized become invalid (COM pointers require marshalling to make them valid in a different thread but I wanted to know if any oter solution is possible). This problem is not coming if we use Jigsaw as our web server. Is there any option in Tomcat which can make Tomcat use one thread for calling native methods? Or is there any other solution to this problem? Khurram.
--------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]