[omniORB] Omniorb 3.0.2 and MFC

Brenneis, Steve steve.brenneis@attws.com
Fri, 26 Jan 2001 08:10:45 -0500


omniORB uses its own threads library which is based on either POSIX threads
(on Unix flavors and VMS) or Win32 threads (on Windows). omniThreads is as
close to bullet-proof as I've seen.

In most cases you cannot access or execute MFC code or resources from
omniThreads. In some instances, you can invoke a macro (used to be
AfxManageThreadState, maybe still is) upon entry into a section of MFC
thread code and it would survive the close encounter. This doesn't always
work and the rules under which it does work seem to be governed by phases of
the moon or some other Microsoft arcana. In fact, most MFC threads  can't
access or execute other MFC threads or their resources. If you need an MFC
thread (especially one which has a window)to act upon something going on in
an omniThread, it is usally best to use PostMessage or even
PostThreadMessage (if that one is still around). Don't use SendMessage since
the recipient processing is done within the same thread. All MFC threads
have an idle processing loop and the thread will process the message when it
gets to it.

omnniORB does not use MFC threads. Those of us who have used omniORB on
MS-Windows really appreciate that and hope it will never change.

Hope this helps.

-----Original Message-----
From: Demron Ignace [mailto:dignac@ftw.rsc.raytheon.com]
Sent: Thursday, January 25, 2001 4:17 PM
To: omniorb-list@uk.research.att.com
Subject: [omniORB] Omniorb 3.0.2 and MFC




I am having a serious problems with threads created in the CORBA layer
executing
MFC calls in my implementation class.  Does OmniOrb make use of MFC threads?