logoff/shutdown philosophy with out-of-process servers
- From: "Jason S" <jmsachs@xxxxxxxxx>
- Date: 25 May 2006 12:55:07 -0700
I have an out-of-process server that handles datalogging automatically
(it does spawn threads to manage new data on a periodic basis as long
as the COM object that spawned the thread is alive) & am trying to
figure out some lifecycle issues for the objects it creates.
This is not a question about how to handle WM_QUERYENDSESSION and
WM_ENDSESSION (I found most of the threads on this newsgroup) in the
server's _Module object. If I have to go there, I will have
questions...
....but my question first is whether to go there, e.g. whether there is
any reason to make the server autonomous with one or more COM objects
keeping themselves alive until explicitly asked to quit or until the
server detects WM_QUERYENDSESSION. (vs. the usual lifecycle approach
which is to be subservient to the client via refcounts and die when the
refcount reaches 0.)
are there any good real-world examples of doing this?
I have almost convinced myself that it's not necessary; if I have a
datalogging COM object doing its thing, then there should be some kind
of client program that "cares" about the COM object by holding onto an
interface pointer; if there are no client programs that care about the
COM object then there's no reason for the object to stay around. From a
user's interactive point of view, it means that in order for the
datalogging object to be around, the user either has to run a script or
other program that programmatically creates & then releases the object,
or the user has to keep open some kind of interactive control panel
thingy that holds onto interface pointers.
if there are obvious holes in this argument, I would appreciate hearing
them.
.
- Follow-Ups:
- Prev by Date: Re: ATL Com
- Next by Date: Re: logoff/shutdown philosophy with out-of-process servers
- Previous by thread: CreateInstance
- Next by thread: Re: logoff/shutdown philosophy with out-of-process servers
- Index(es):
Relevant Pages
|