Serializing Requests


In ActiveX (OLE) DLLs created with Visual Basic 4 (and also ActiveX server applications), if two threads need to call methods in the same DLL, they have to take turns. The second thread has to wait until the first thread has finished its method call. This is called serializing requests. It doesn’t matter if the two threads are calling the same method or different methods. The DLL can only accommodate a single thread at any one point in time.

If the threads or separate applications are calling to an out-of-process ActiveX server application - either on the same machine or another machine - the operating system takes care of making sure that the second call waits for the first to finish. If the two calls are coming from two threads to an ActiveX DLL, which is running as an in-process server, the application making the calls needs to make sure that the second thread waits until the first is finished.

The following are two issues with this serialization of requests:

Either way, if there were another option available that allowed multiple threads to make calls to the same DLL or out-of-process server such that they all could be serviced simultaneously, that option would be preferable.