Re: VARIANT and multithreading

Tech-Archive recommends: Fix windows errors by optimizing your registry



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
>
>
>
.



Relevant Pages

  • Re: Memory usage and large number of pages
    ... The problem is the overhead of compiling these pages is huge - and because ... have also found that for each file that is compiled the memory increases. ... >> directory on the web server. ... >> returns the result of this page back to the client. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: how to pass lots of data from unmaged to manage code using CCW
    ... Derive a class from System.EnterpriseServices.ServicedComponent and register the class to run as a COM+ server type application. ... Install the proxy on the client machine. ... COM clients and .NET clients can now call the COM+ server application on the remote server. ... so i have to prepare variant type in c++. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Named shared memory without synchronization
    ... memory address with a single machine instruction. ... Again, if I assume an x86/x64 architecture I think i can get away with this, ... when running on a 4-way server under heavy load. ... Server runs client. ...
    (microsoft.public.vc.language)
  • Possible bug in sockets
    ... Just point the ip address of the client at the server ... The client connects 200 sockets, sends some data with each continously, ... in this scenario memory increases forever. ...
    (microsoft.public.dotnet.framework)
  • RE: Exchange 2003 and timeout errors on XP machines
    ... After replacing 1 client computer's network cable, ... Are you able to open OWA to access the e-mails on the client or server? ... Store.exe will take as much memory as possible to provide better service ... Microsoft engineers can only focus on one issue per thread. ...
    (microsoft.public.windows.server.sbs)