Solved

Use existing c++ dll in Web Application

Posted on 2004-09-30
6
179 Views
Last Modified: 2010-03-17
Hi, i have a existing system in c++.
I have Many not thread safe dll´s.
I want to call them from my java web application.

Is there a better way to then use SingleThreadModel and isThreadSafe = "false"?

Is there a better way than copying, renaming and reloading the dll for every user?

I can´t make the dll´s thread safe. this would take me too long. (very much code to check)
the SingleThreadModel would be to slow (yes, i tried it :-( )

creating a new process with Runtime and connect to it with rmi is also too slow (i also tried that :-( )
0
Comment
Question by:Koma666
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 13

Expert Comment

by:petmagdy
ID: 12326662
Hello I have a suggestion that may help:

1- Create a Single Tone Java Class to wrap the Native DLL APIs and make all the methods synchronized

the single tone class looks like this:

class MySingleTone
{
 
  private static MySingleTone instance = null;

  private MySingleTone()
  {
     // Initialize
  }
 
   public static MySingleTone getInstance()
   {
     if(instance == null)
     {
        instance = MySingleTone();
     }
     return instance;
   }

   public synchronized callDllMethod()
   {
     // call ur DLL functions
   }

}
0
 
LVL 5

Author Comment

by:Koma666
ID: 12562995
I can´t do that.
The dll has to be initiated for every user.
It´ll crash if i use one instance for all users.
0
 
LVL 5

Author Comment

by:Koma666
ID: 12563007
I found a way
I found a way to speed up the single thread model by using more cach funktions.
So it´s not the best way but it´s fast enough to use it.
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 12573297
PAQed with points refunded (250)

modulo
Community Support Moderator
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Convert websphere application server default chained Certificates from 1024 to 2048 keysize or higher size and also you can change signatureAlgorithm . Please make sure Websphere Application Server fixpack 7.0.0.23 or Above. The following steps a…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question