15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


calling an interface marshalled for a different thread

Ludek Slegr -- ludek.slegr@munich.ixos.de
Friday, April 12, 1996

Environment: Windows NT 3.51, VC++ 4.0

Hi Experts,

We have an interface marhsalled for the main application thread - the =
application is OLE Automation server and gets the interface through a =
call to one of its OLE Automation methods . Now, we would like to use =
this interface from our worker thread too. Is there some nice solution =
for this problem ? I mean something like "remarshalling" the interface =
for the worker thread. Thanks for any hint.

Regards,
Ludek

e-mail:    Ludek.Slegr@munich.ixos.de
phone:   +49-89-46005-311
fax:        +49-89-46005-199



David W. Gillett -- DGILLETT@expertedge.com
Wednesday, April 17, 1996

> We have an interface marhsalled for the main application thread -
> the application is OLE Automation server and gets the interface
> through a call to one of its OLE Automation methods . Now, we
> would like to use this interface from our worker thread too. Is
> there some nice solution for this problem ? I mean something like
> "remarshalling" the interface for the worker thread. Thanks for
> any hint.

  I haven't seen any other answer to this, so I'll take a stab at it.

  My understanding, such as it is, of marshalling of OLE interfaces, 
is that it's the mechanism for transporting interface calls and their 
arguments from one address space to another.  You particularly need 
this with out-of-proc servers under Win32, since the server is 
running in a separate address space from the client.
  My understanding of threads is that the threads of a process all 
operate in the same address space.  So as long as things are 
marshalled to/from the process address space you're interested in, 
that should be sufficient -- I don't see any part of marshalling that 
needs to work on a per-thread basis.  [If I've got this wrong, I'd 
really like to know!]

  It does occur to me to wonder "What if the server is not 
re-entrant?", but it seems to me that it must be in order to handle 
(potentially) multiple clients, and so handling multiple threads 
calling the same server should not be an issue.

Dave

 




| Вернуться в корень Архива |