Re: VARIANT and multithreading
- From: "sundarprasath" <sundarprasath@xxxxxxxxx>
- Date: Wed, 11 May 2005 19:21:03 -0700
Generally the client should create the memory and it should send the ref of
the memory to the server and once the server finishes its work the client
should delete the memory. Then that problem will not come.
Server should receive the referance of the object.
"Igor Tandetnik" wrote:
> "Palmer Eldritch" <PalmerEldritch@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
> message news:3DB319CE-EDC2-4C08-9A2C-ADF24AE80BBD@xxxxxxxxxxxxx
> > "Igor Tandetnik" wrote:
> >> Are clients' interface pointers correctly marshalled between threads?
> >
> > Do I have to marshall interfaces between threads initialized with
> >>> CoInitializeEx(0,COINIT_MULTITHREADED)?
>
> No you don't.
>
> >> Are the VARIANTs correctly marshalled between threads (only needed
> >> when they may themselves contain interface pointers)?
> > The VARIANT is VT_ARRAY|VT_VARIANT and elements are of various types:
> > VT_BSTR,VT_I4,VT_DATE. No interface pointers.
> > The VARIANT is not marshalled in any way and one can think of it as a
> > global variable - each thread uses the same.
>
> That's OK, as long as there are no interface pointers involved.
>
> >> May it be that you are trying to clear the variant on one thread
> >> while the call involving it is still in progress on some other
> >> thread? This won't work, for obvious reasons.
> >
> > Probably not. The VARIANT is externally reference counted so it
> > should be preserved.
>
> I can think of only two reasons for VariantClear to fail the way it
> does: either the call is still in progress and the client holds the
> safearray locked, or the client is buggy and keeps the safearray locked
> even after returning from the call (a valid client should make a deep
> copy of the array if it plans to keep the data around after returning
> from the call).
> --
> With best wishes,
> Igor Tandetnik
>
> With sufficient thrust, pigs fly just fine. However, this is not
> necessarily a good idea. It is hard to be sure where they are going to
> land, and it could be dangerous sitting under them as they fly
> overhead. -- RFC 1925
>
>
>
.
- References:
- VARIANT and multithreading
- From: Palmer Eldritch
- Re: VARIANT and multithreading
- From: Igor Tandetnik
- Re: VARIANT and multithreading
- From: Palmer Eldritch
- Re: VARIANT and multithreading
- From: Igor Tandetnik
- VARIANT and multithreading
- Prev by Date: Re: Registering in ROT with ROTFLAGS_ALLOWANYCLIENT
- Next by Date: GetActiveObject Fails.
- Previous by thread: Re: VARIANT and multithreading
- Next by thread: Registering in ROT with ROTFLAGS_ALLOWANYCLIENT
- Index(es):
Relevant Pages
|