|
|
|
|||||
|
ICE in COM DLL Server can not exit??
I use ice in a COM dll server.It worked well.
But when It exit,it blocked at the Ice::Communicator "destory" method infinitely! this is the call stack: IceUtil::ThreadControl::join() line 50 IceInternal::ThreadPool::joinWithAllThreads() line 349 + 46 bytes IceInternal::Instance::destroy() line 936 Ice::CommunicatorI::destroy() line 74 + 21 bytes CCommunicator::Uninit() line 55 + 47 bytes CSeurityInfoApp::ExitInstance() line 84 DllMain(HINSTANCE__ * 0x10000000, unsigned long 0, void * 0x00000000) line 139 _DllMainCRTStartup(void * 0x10000000, unsigned long 0, void * 0x00000000) line 273 + 17 bytes NTDLL! 7c94a352() NTDLL! 7c969dee() KERNEL32! 7c82b1bb() the demo project in the demo project. CServer is listen on tcp port 10000 CClient is normal client in normal way access cserver. SeurityInfo is the COM dll server.the dll wrapper the CClient in COM way. encounter the problem that mentioned earlier!!! Test_SecurityInfo is the C++ Client call the COM dll server. CServer <===> CClient work well. you can use it test the server service. CServer <===> SeurityInfo has problem. When SeurityInfo exit,it blocked. My C++ Developer tool is MS VC++6.0 + SP6. Hope for help. Thanks for your attention.
__________________
Last edited by jans : 07-13-2007 at 05:20 AM. |
|
||||||
|
I looked into your problem, and your example does indeed hang. The problem is that you are attempted to destroy the communicator in the DLL_PROCESS_DETACH notification on the COM object. Destroying the communicator destroys and joins with the threads that it created. The problem is that joining with threads in the DLL_PROCESS_DETACH notification is illegal.
DllMain (Windows) "Because DLL notifications are serialized, entry-point functions should not attempt to communicate with other threads or processes. Deadlocks may occur as a result." You are seeing a deadlock, as the documentation says. Therefore, what you must do instead is arrange to destroy the communicator before this notification occurs. |
|
|||||
|
Thanks a lot for your quick response.
I will thank you again when I resolve the problem. Thank you and all the other staff.
__________________
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| use ice in dll? | cool stone | Help Center | 4 | 05-23-2007 07:52 AM |
| Traditional DLL being loaded by .NET DLL - Unable to Find dependencies | mboozell | Help Center | 3 | 05-02-2007 10:51 AM |
| Caught an unknown Exception and program exit! | Yunqiao Yin | Help Center | 11 | 10-31-2006 08:37 AM |
| Error message on "run" exit | Larry | Help Center | 10 | 07-13-2006 01:54 PM |
| how to pack a server to a dll | simpley | Help Center | 4 | 01-13-2005 04:06 AM |